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.
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.
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
- Intercept the file upload request using Burp Suite.
- Modify the MIME type of a PHP script to image/jpeg.
- 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.