Skip to content
Path traversal Write-up Intermediate

Chaining Path Traversal with SSRF to disclose internal git repo data in a Bank Asset

A bank application fetched JavaScript files from an internal GitHub repository using a user-supplied filename, without restricting directory traversal. An attacker could traverse out of the intended repository path and query other GitHub API endpoints, disclosing private internal repository data.

Nikhil Follow

Published on blog.niksthehacker.com

Its been a while i have published anything. This was a small issue with bigger impact.

Nikhil (niks), on blog.niksthehacker.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 passed the user-controlled cdnFileName value into a GitHub API path without normalising or restricting it, allowing path traversal and access to other API endpoints.

Impact

An attacker could read private data from the bank's internal GitHub repository through the application's response.

What the attacker needed

Access to the vulnerable endpoint; no authentication barrier mentioned

How it was found

  1. Notice the cdnFileName parameter controls which file is fetched from the internal GitHub repo.
  2. Traverse upward with ../ sequences to reach the repository root path.
  3. Append a query string with ? so the application does not add .js to the requested name.
  4. Request a GitHub API endpoint such as events and observe the private repository data 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.

The site let you name a file it would fetch from GitHub, and it did not check that the name stayed inside the intended folder. By putting '../' sequences in the name, you can climb up to other parts of the GitHub API and read things you should not see. The '?' trick stops the site adding '.js' to the end of the name.

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 Nikhil

View all

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