Skip to content
Path traversal Disclosed report Beginner

[sirloin] Web Server Directory Traversal via Crafted GET Request

The Sirloin web server module did not check that requested files stayed inside the served root directory, so a crafted URL with encoded dot-dot sequences could reach files elsewhere on the host. An attacker could read arbitrary system or application files, and the server listens on all interfaces by default.

bp0lr Follow

Originally disclosed on HackerOne

  • Triaged in 10 hours
  • Fixed in 7 months
  • Disclosed after 7 months

I would like to report path traversal in Sirloin module. It allows an attacker to read system files via path traversal local/remote

Module

module name: Sirloin version: 0.15.0 (latest release build) npm page: https://www.npmjs.com/package/sirloin

Module Description

This high performance, extremely easy to use web server.

Module Stats

downloads in the last year 4,129

Vulnerability

Vulnerability Description

Directory traversal through the url which doesn't verify the file is from the root directory path.

Steps To Reproduce:

1 npm install sirloin 2 start the local server by typing nodejs node_modules/sirloin/bin/sirloin.js 3 curl "http://localhost:3006/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd"

it will list the content of /etc/passwd

Wrap up

  • I contacted the maintainer to let them know: [N]
  • I opened an issue in the related repository: [N]

Impact

An attacker can leverage this vulnerability to request arbitrary files from the target host, which may include application source code or system files. The package by default listen to 0.0.0.0 enabling external access.

The original report as published on HackerOne, by bp0lr. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could request arbitrary files from the target host, potentially including application source code or system files, and the default binding to all interfaces may expose this to external networks.

What the attacker needed

Sirloin server running; network access to the server port

How it was found

  1. Install the sirloin package with npm.
  2. Start the local server by running its bundled script.
  3. Send a request whose URL contains encoded dot-dot sequences pointing at a system file.
  4. Observe the contents of that system file returned in the response.

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 report has not been written yet. The Original tab links to the source.

A web server normally hands out files only from one folder it is told to serve. Here it took the path from the URL and used it without checking, so a visitor could climb out of that folder using '..' (meaning 'go up one level') and ask for files elsewhere on the machine. The report shows this working against a standard system file that lists user accounts.

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 bp0lr

View all

1 more disclosed report, best first.

More from Node.js third-party modules

View all

The newest disclosed reports for this program.

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.