pentesting, updated
Test upload of unexpected file types
Check whether the upload feature accepts file types it shouldn't, based on extension, content-type, or actual content.
Goal
Confirm uploads are validated by actual content, not just extension or client-supplied Content-Type.
How to test
Upload a file type the feature shouldn’t accept, then try the usual bypasses if it’s blocked:
curl -s https://example.com/upload -F "file=@shell.php"
curl -s https://example.com/upload -F "file=@shell.php.jpg" # double extension
curl -s https://example.com/upload -F "file=@shell.php%00.jpg" # null byte (legacy stacks)
curl -s https://example.com/upload -F "file=@shell.phtml" # alternate executable extension
What to look for
A disallowed file type accepted because validation only checked the extension or the client-supplied MIME type, not the actual content.
References
- OWASP WSTG-BUSL-08 — Test Upload of Unexpected File Types.