Skip to content
Path traversal Write-up Beginner

When an Image Endpoint Opened the Entire Server: My Discovery of

An image-rendering endpoint accepted a user-controlled file path and returned files from anywhere on the server's filesystem. An attacker could read sensitive system and configuration files and potentially chain this into further compromise.

Anshubind Follow

Published on medium.com

Sometimes, the simplest endpoints hide the biggest security holes. And sometimes, a parameter that’s meant to load an image ends up loading… the entire operating system.

Anshubind, 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 endpoint passed the user-supplied path parameter directly to a file-reading function without validating or restricting it to a safe base directory.

Impact

An attacker could read sensitive system files such as configuration, logs and authentication files, and the author claims this could lead to source code disclosure, credential harvesting, remote code execution or privilege escalation.

What the attacker needed

Publicly reachable analytics instance; no authentication needed

The fix

The endpoint should reject traversal sequences, canonicalise paths before validation, restrict reads to a hardcoded base directory, and never pass raw user input to file-handling functions; the text says the report was taken forward for remediation but does not confirm a fix.

How it was found

  1. Find the publicly exposed analytics instance and the showImage endpoint that takes a path parameter.
  2. Add directory traversal sequences to the path parameter to test for protections.
  3. Observe that the server returns raw file contents instead of an error.
  4. Request a known system file through the path parameter and confirm sensitive data is returned.

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 web server often has files it should only use itself, like configuration files or password files. This endpoint was meant to show an image but let the visitor choose any file path, so adding '..' steps moved the request outside the image folder. The server then sent back whatever file was asked for, including system files.

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 Anshubind

View all

15 more disclosed reports, 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.