Skip to content
Path traversal Write-up Beginner

$4500 Local File Inclusion: The Tiny Parameter That Exposed an Entire Infrastructure

A support-ticket attachment download feature accepted a user-controlled URL parameter and fetched it without restricting schemes, allowing an authenticated user to read arbitrary local files. The attacker could retrieve sensitive files from the server.

cyberknight Follow

Published on medium.com

Me and my hunting partner Krishna Agarwal were hunting on a target which was basically a cloud service providing platform. I had gone through every functionality of the application for potential attack vectors.

Swapnil Ade, 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 server used a generic fetch helper that did not validate the URL scheme or restrict file paths to an attachments directory.

Impact

An authenticated attacker could read arbitrary local files on the server, potentially exposing sensitive information.

What the attacker needed

Authenticated user; access to support-ticket attachment feature

The fix

The issue was acknowledged and a bug bounty reward was granted, but the text does not explicitly state a fix; it should be fixed by enforcing a scheme whitelist and canonical path validation.

How it was found

  1. Intercept the request used to download an attachment.
  2. Replace the download_url parameter value with a file:// URI pointing to a local file.
  3. Send the request; the server returns the file contents.

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 application had a feature to download attachments, but it trusted a URL supplied by the user. By changing that URL to point to a local file on the server, the attacker could make the server return the contents of that file. This is called Local File Inclusion (LFI).

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.