pentesting, updated
Test upload of malicious files
Check whether an accepted file type can still carry a payload that executes or harms other users.
Goal
Confirm uploaded files can’t achieve code execution or harm other users even when the type itself is allowed.
How to test
For an allowed type that still shouldn’t be dangerous, test the angle that fits it:
- Images — embed a payload in EXIF/metadata, or test for ImageTragick/library-specific processing bugs.
- SVG — SVG is XML; it can carry
<script>and trigger stored XSS when rendered inline. - Office docs — macro-based payloads.
- Executables reaching a webshell path — if the upload directory is web-accessible and scripts there execute, an allowed extension plus that path is enough:
curl -s https://example.com/uploads/shell.php?cmd=id.
What to look for
A file that executes (a webshell reachable and runnable), or triggers stored XSS/malware when another user opens or views it.
Notes
Also worth checking: does the app scan uploads for malware at all, and is the upload directory excluded from script execution?
References
- OWASP WSTG-BUSL-09 — Test Upload of Malicious Files.