Skip to content
Path traversal Write-up Intermediate

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

Asyary Raihan, 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

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

  1. Convert a file on the website and observe the file parameter in force_download.php pointing to a directory.
  2. Change the file parameter to index.php and see the file contents returned.
  3. Upload a PNG with a crafted Profile tEXt chunk to read /etc/passwd via ImageMagick.
  4. Use LaTeX injection with Unicode hex encoding to bypass filtering and execute commands.
  5. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.