Field guide
File upload and injection
The journey from a profile picture to server execution.
When a web form tells your browser to accept only .png or .jpg, treat that check as a polite suggestion, never a real security boundary. The moment an app accepts a file upload, it sends untrusted bytes into backend services that store, rename, serve, resize, and parse it.
That is why file upload vulnerabilities are rarely a single bug. They are a chain of handoffs where one component trusts the last one a little too much.
Where trust breaks down
Section titled “Where trust breaks down”Most engineering teams already guard against SQL injection and reflected XSS, yet raw file pipelines slip through the cracks. The storage layer trusts the filename, the image library trusts the raw bytes, the web server trusts the extension, and the browser trusts the Content-Type header. You only need one link in that chain to make a bad assumption.
The six stations
Section titled “The six stations”Every uploaded file passes through six stations, each with its own failure mode:
- Station 1 is the validation gate.
- Station 2 is storage and file naming.
- Station 3 is serving files back to browsers.
- Station 4 is server-side parser execution.
- Station 5 is second-order background processing.
- Station 6 is dormant client or admin triggers.
Beginners spend almost all their time poking at Station 1 with .php shells and give up when the filter holds. Experienced hunters move downstream to Stations 3 through 6, where inline SVGs, legacy C image libraries, and document converters quietly do the heavy lifting.
How to use this guide
Section titled “How to use this guide”Read through the six stations first so you can picture the whole pipeline, then keep the interactive checklist open while testing authorized targets. Prove code execution with harmless commands like id or whoami, and clean up every uploaded test file once you capture your proof.
Open local graph around this page
Linked from here
Links out to
No outgoing internal links on this page.
File UploadFor authorized testing only.