Inspect File Upload Surface
Goal
Determine whether upload features create unsafe execution, storage, parser, or exposure paths.
Assumptions
- uploads may be validated weakly
- post-processing is often riskier than the upload itself
- storage and serving paths may cross trust boundaries
Prerequisites
- one or more upload or import features
- ability to inspect storage, response behavior, or processing side effects where authorized
Recon steps
- Map all upload and import entry points.
- Identify where files are stored, transformed, previewed, or served.
- Note allowed extensions, MIME handling, naming, and public exposure.
Exploit / test steps
- Compare extension checks vs actual parser behavior.
- Test whether uploaded content is served back from executable or overly trusted contexts.
- Probe archive and document processing paths.
- Inspect filename handling and path assumptions.
- Look for predictable public URLs or indirect exposure of stored files.
Validation clues
- unsafe file types accepted or mishandled
- uploaded content becomes publicly reachable unexpectedly
- processing path reveals parser or storage issues
- files can influence downstream rendering or server behavior
Mitigation
- validate more than extension alone
- isolate storage and serving paths
- avoid execution-capable contexts
- review previews/transforms as part of the attack surface
- use indirect references and safe naming
Logging / detection
- unusual upload MIME/type combinations
- repeated failed processing attempts
- public access to files that should remain private
Related notes
References
- Testing / Lab: PortSwigger file upload vulnerabilities — https://portswigger.net/web-security/file-upload
- Foundational: OWASP WSTG — https://owasp.org/www-project-web-security-testing-guide/latest/