GithubHelp home page GithubHelp logo

gaurabb / ipvl-csharp Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 62 KB

Input Validation Library - C#

License: MIT License

C# 100.00%
c-sharp secure-file-upload magic-numbers file validation-library

ipvl-csharp's Introduction

ipvl - input validation library

[Still Work In Progress]

Secure Input Validation Library - C#

Secure File Upload Checks

  • File exists
  • File size validation
  • File extension validation
  • File magic number validation

How File Extension and Magic Number Checks done?

  • The code will first check for the extension of the uploaded file.
  • If the extension is in the whitelist then the magic number check will be performed.
  • The code will read the magic number value of the uploaded file's type based on the extension.
  • If the magic number is valid then the file is marked as a valid file.

The magicnumbers.txt file in the root folder is used to obtain the "magic numbers" for validation. When the IPVL is invoked, the constructor of the IPVL class will check for the magicnumbers.txt file in the project root. If found, the values obtained from this file will be used. If the file does not exist, then a new file will be created and the default set of magic numbers will be written into this file and used for validation.

If new file types needs to be supported then the magic number values can be added to the magicnumbers.txt file in the following format, one key value per line:

.<filetype>=<magic#Value>
Eg.
.bmp=42-4D

ipvl-csharp's People

Contributors

gaurabb avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.