Skip to content
File upload Write-up Intermediate

How I Found a Critical Vulnerability and Earned $4,000 in Bug Bou

The server did not properly validate the MIME type of uploaded files, allowing an attacker to upload a PHP script disguised as a JPEG and execute arbitrary code on the server. This gave the attacker full control of the server.

Krish_cyber Follow

Published on krishna-cyber.medium.com

This is the world of bug bounty hunting — a thrilling mix of cybersecurity, problem-solving, and, yes, the occasional adrenaline rush. In this blog, I’ll take you through my journey of finding a critical vulnerability, reporting it responsibly, and earning a bounty.

Krish_cyber, on krishna-cyber.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

Root cause

Likely the server trusted the client-supplied MIME type instead of validating the file's actual content or extension.

Impact

An attacker could gain full control of the server, leading to data theft, service disruption, or further exploitation.

What the attacker needed

A user account with profile picture upload; ability to intercept HTTP requests

How it was found

  1. Intercept the file upload request using Burp Suite.
  2. Modify the MIME type of a PHP script to image/jpeg.
  3. Upload the file and access it via the browser to execute arbitrary code.

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 file upload feature lets users send files to a website. The server should check what kind of file it is, but here it only looked at a label the user can change. By changing that label, the attacker uploaded a program that the server then ran, giving them control.

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 Krish_cyber

View all

12 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.