Skip to content

Field guide

File upload and injection

The journey from a profile picture to server execution.

2 min readFile Upload

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.

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.

Every uploaded file passes through six stations, each with its own failure mode:

  1. Station 1 is the validation gate.
  2. Station 2 is storage and file naming.
  3. Station 3 is serving files back to browsers.
  4. Station 4 is server-side parser execution.
  5. Station 5 is second-order background processing.
  6. 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.

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.

Connections2 backlinks · 0 outgoing · 2 cross-guideFull graph →
Open local graph around this page
Open full graph →
Click a node to open · Drag to reposition · Scroll to zoom

Links out to

No outgoing internal links on this page.

File UploadFor authorized testing only.