Skip to content
File upload Write-up Beginner

Critical File Upload Vulnerability: Web Shell Upload via Content-

The application validated file uploads using the client-supplied Content-Type header, allowing an attacker to upload a server-side executable file. Accessing the uploaded file caused the server to execute the payload, demonstrating remote code execution.

Ethical Hacker Follow

Published on medium.com

The application relied on the client-controlled Content-Type header during file upload validation. By modifying this header in the intercepted HTTP request, I was able to bypass the upload restrictions and successfully upload a server-side executable file.

Ethical Hacker, on medium.com

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

Impact

An attacker could upload and execute arbitrary code on the server, leading to remote code execution.

What the attacker needed

Ability to upload files; ability to intercept HTTP requests

How it was found

  1. Intercept the file upload request.
  2. Modify the Content-Type header.
  3. Upload a server-side executable file.
  4. Access the uploaded file to trigger execution.

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.

When you upload a file, your browser sends a label saying what type of file it is. This application trusted that label completely, so someone could lie about the file type and upload a program that runs on the server. That let the attacker run their own code on the server.

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.

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.