Skip to content
Path traversal Write-up Intermediate

How I Found My First Critical Bug Bounty | Unauthenticated Arbitrary File Upload Lead To LFI via…

An unauthenticated file upload endpoint allowed filenames containing path traversal sequences, so an attacker could cause the server to read and store arbitrary local files such as /etc/passwd. The uploaded files were then publicly accessible via a CDN URL, exposing sensitive system files.

terp0x0 Follow

Published on medium.com

Today I want to share my bug bounty journey and how I found my first critical bug. 🎯

SudoHunt, 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 upload handler used the user-supplied filename without sanitising path traversal sequences, and stored the file in a publicly accessible location.

Impact

An unauthenticated attacker could read and publicly expose sensitive local files from the server, including system configuration and credential files, though code execution was not achieved.

What the attacker needed

No authentication required; access to the file upload endpoint

How it was found

  1. Find the file upload endpoint through content discovery.
  2. Upload a normal text file and confirm it is publicly accessible via the returned CDN URL.
  3. Try uploading a PHP file and observe it is served as static content, not executed.
  4. Upload a file with a filename containing path traversal sequences to target /etc/passwd.
  5. Observe the returned URL points to a file named passwd, confirming the local file was read and stored.
  6. Repeat with other sensitive system files to increase impact.

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 let anyone send a file without logging in. The server used the filename as given, so by putting '../' sequences in the name, the attacker made the server grab files from its own operating system (like the password file) and save them where anyone could download them. This is called local file inclusion: tricking a program into reading files it should not.

What is Path traversal?

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

More by terp0x0

View all

1 more disclosed report, best first.

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.