Tips

File upload tips

File upload bugs let attackers store files the application should refuse: scripts that run on the server, HTML or SVG that runs in users’ browsers, or files that overwrite others. Checks on extension, type and content often disagree.

Published tips, newest first. Payloads and commands are shown as plain text.

File upload: how to hunt it

Where to look

  • Extensions and types checked only in the browser, or by a blocklist that misses variants.
  • SVG, HTML and XML uploads served from the site’s own origin.
  • File names with path traversal, and uploads that overwrite existing files, tried only on files of your own.
  • Image processing libraries and converters with known vulnerabilities.

What proves it

Show the uploaded file running or rendering where it should not, such as a harmless script on the target’s origin, and delete it afterwards.

Read further

Writeups on File upload, by hunters and researchers, most with a short summary.

Related classes