$600 Vulnerability: My First Bug Hunting Journey
The website's file download parameter allowed path traversal, letting an attacker read arbitrary files. Additionally, an ImageMagick flaw enabled arbitrary file read via a crafted PNG, and a LaTeX service was vulnerable to injection leading to remote code execution.
medium.com
Published on medium.com
This happened about (more than) a year ago, so I don’t really have all the documentations of what happened. All parties involved have given me permission to share this story with you all.
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 file download script passed user input directly to a file-reading function without validation, and the LaTeX service failed to sanitise user-supplied commands.
What the attacker needed
Access to the website; ability to upload files; LaTeX service exposed
The fix
The vulnerabilities should be fixed by validating user input, updating ImageMagick, and sanitising LaTeX commands.
How it was found
- Convert a file on the website and observe the file parameter in force_download.php pointing to a directory.
- Change the file parameter to index.php and see the file contents returned.
- Upload a PNG with a crafted Profile tEXt chunk to read /etc/passwd via ImageMagick.
- Use LaTeX injection with Unicode hex encoding to bypass filtering and execute commands.
- Write a malicious PHP payload to the upload folder to achieve remote code 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.
The website had several security holes. One let anyone read files on the server by changing a link. Another let someone run their own code on the server by abusing a document converter. These mistakes can expose sensitive data or let attackers take control.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.