Skip to content
File upload Write-up Intermediate

Unrestricted CV File Upload

The CV upload feature accepted files whose names ended in .pdf and whose contents began with a PDF signature, even though the body was HTML with a script. An attacker could upload such a file so that an employee opening it locally would run the script, revealing the employee's IP, browser, OS and local download path.

vict0ni Follow

Published on web.archive.org

While I’m stuck at quarantine like the rest of the world, I have more time to work on my web app hacking skills by doing some bug bounties. From those bugs that I found in this long BB session of mine, I got to report my first Unrestricted File Upload.

vict0ni, on web.archive.org

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the upload check trusted the file extension and a spoofable magic-byte prefix instead of validating the real content type and serving the file safely.

Impact

The script ran only when an employee opened the downloaded file locally, so no company cookies were exposed, but it could reveal the employee's IP, geolocation, browser, OS and local download path; executable files were also accepted.

What the attacker needed

Attacker can submit a CV upload; employee opens the downloaded file; file opened outside the web app

How it was found

  1. Upload a basic HTML file and observe it is rejected before any content check.
  2. Rename the file so it ends in .pdf and see it accepted by the name check.
  3. Add a PDF signature at the top of the HTML file to pass the content check.
  4. Change the Content-Type so the file is downloaded and opened as HTML.
  5. Include a script that reports back when the file is opened.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A website let people upload a CV. It checked only the file name ending and the first few bytes of the file, not what the file really was. So someone could hide a small web page with a script inside a file that looked like a PDF, and when an employee opened it on their own computer the script ran.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by vict0ni

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.