Skip to content
Path traversal Write-up Intermediate

Alright — I’ll expand your English writeup into a full, d

A file parameter on two subdomains allowed reading arbitrary local files, exposing environment variables and configuration files. The leaked secrets included a JWT signing key, database credentials, and a GitHub token, which the hunter used to forge authentication tokens and access private APIs and source code repositories.

Dmitry Sorokin Follow

Published on medium.com

This is the story of how a seemingly simple Local File Inclusion (LFI) vulnerability escalated into a complete API and infrastructure compromise during a bug bounty engagement.

Dmitry Sorokin, 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 application passed user-supplied input directly to a file-reading function without validating or restricting the path.

Impact

The chain could allow full API compromise, database breach, source code leak, and lateral movement to other internal services.

What the attacker needed

No authentication required; Target runs a vulnerable file parameter

The fix

The report recommends input validation, access controls, secret management, token rotation, and logging; it does not state that a fix was applied.

How it was found

  1. Send a request to business.max.ru with the file parameter set to /etc/passwd and observe system file contents in the response.
  2. Request the .env file on help.max.ru using the same file parameter to retrieve environment variables.
  3. Extract secrets such as JWT_SECRET, database credentials, and a GitHub token from the retrieved files.
  4. Use the JWT_SECRET to forge an authentication token and send it to a private API endpoint, which returns data without password authentication.

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 parameter is meant to let a website load a specific file, but here it accepted any file path on the server. By asking for system files like the password file, the hunter could read them. Those files contained passwords and secret keys, which then let the hunter pretend to be any user and reach private systems.

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.