[VPAT-16] improvement: add file validation to prevent malicious uploads #8493

Add client-side checks for double extensions, dangerous file types,
dot files, and path traversal patterns. Addresses security audit
recommendations for file upload validation.
This commit is contained in:
Prateek Shourya 2026-02-17 00:21:21 +05:30 committed by GitHub
parent 49fc6aa0a0
commit e10deb10f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 70 additions and 10 deletions

View file

@ -18,3 +18,22 @@ export const ACCEPTED_COVER_IMAGE_MIME_TYPES_FOR_REACT_DROPZONE = {
"image/png": [],
"image/webp": [],
};
/**
* Dangerous file extensions that should be blocked
*/
export const DANGEROUS_EXTENSIONS = [
"exe",
"bat",
"cmd",
"sh",
"php",
"asp",
"aspx",
"jsp",
"cgi",
"dll",
"vbs",
"jar",
"ps1",
];