Insecure file upload
Description
The system allows the upload of files with two extensions or with unsafe ones, such as .html, .php or .exe. Furthermore, the system does not validate whether or not the file is free from malicious code.
Impact
Upload malicious files to the server.
Recommendation
- Validate with regular expressions that the file has only one extension. - Validate with an antivirus software that the file does not contain any type of malicious code. - Validate that Content Type corresponds to the files extension before upload it to the server.
Threat
Authenticated attacker from the Internet.
Expected Remediation Time
⏱️ 30 minutes.
Requirements
040 - Compare file format and extension041 - Scan files for malicious code042 - Validate file formatRules
Typescript Unrestricted File UploadRuby Dangerous Io Copy StreamJava Unrestricted File UploadTypescript Cordova File ManipulationJava Unrestricted File Upload SpringJavascript Cordova File ManipulationTypescript Unvalidated Xml Parsed In VmJavascript Unrestricted File UploadPhp Unsafe File Upload