File Upload Hardening (Content Sniffing, AV, Storage)
On this page
Upload Risks
- Executable files.
- Polyglot files.
- Large file DoS.
Hardening Checklist
- Validate extension AND MIME.
- Store outside web root.
- Rename files on upload.
- Virus scan before processing.
- Limit file size.
Failure Modes
- Trusting client Content-Type.