Skip to content
Info disclosure Disclosed report Beginner

[bot.brew.sh] Full Path Disclosure

A Jenkins logging endpoint on the affected host exposed environment variables and operating system path information in its build log output. An attacker could read these details to learn the server's internal paths and environment settings.

Andy Gill Follow

Originally disclosed on HackerOne

Medium 5.3 View original
  • Fixed in under an hour
  • Disclosed after 7 days

Full Path Disclosure (FPD) vulnerabilities enable the attacker to see the path to the webroot/file. e.g.: /home/omg/htdocs/file/. Certain vulnerabilities, such as using the load_file() (within a SQL Injection) query to view the page source, require the attacker to have the full path to the file they wish to view.

The affected domain has a logging instance that discloses the full operating system path on certain pages.

Affected URLs:

It was possible to discover the path where the brew distrobution server is installed as can be seen in the output below:

The request GET /job/Homebrew%20Bottles/lastSuccessfulBuild/logText/progressiveText?start=0 HTTP/1.1
Host: bot.brew.sh
Accept-Charset: iso-8859-1,utf-8;q=0.9,*;q=0.1
Accept-Language: en
Connection: Close
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*



produces the following path information :
[EnvInject] - Injecting as environment variables the properties content
HOMEBREW_UPDATE_TO_TAG=1
PATH=bin:/usr/bin:/bin:/usr/sbin:/sbin
HOMEBREW_DEVELOPER=1


The request GET /job/Homebrew%20Bottles/lastFailedBuild/logText/progressiveText?start=0 HTTP/1.1
Host: bot.brew.sh
Accept-Charset: iso-8859-1,utf-8;q=0.9,*;q=0.1
Accept-Language: en
Connection: Close
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*



produces the following path information :
[EnvInject] - Injecting as environment variables the properties content
HOMEBREW_UPDATE_TO_TAG=1
PATH=bin:/usr/bin:/bin:/usr/sbin:/sbin
HOMEBREW_DEVELOPER=1


The request GET /job/Homebrew%20Bottles/lastFailedBuild/logText/progressiveHtml?start=0 HTTP/1.1
Host: bot.brew.sh
Accept-Charset: iso-8859-1,utf-8;q=0.9,*;q=0.1
Accept-Language: en
Connection: Close
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*



produces the following path information :
[EnvInject] - Injecting as environment variables the properties content
HOMEBREW_UPDATE_TO_TAG=1
PATH=bin:/usr/bin:/bin:/usr/sbin:/sbin
HOMEBREW_DEVELOPER=1

Recommendation

Implement basic authentication to protect the root folder, alternatively remove the offending files causing the stack trace errors.

The original report as published on HackerOne, by zephrfish. 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

Root cause

Likely the Jenkins build log endpoints were publicly reachable and printed environment variables and path data without any access control.

Impact

An attacker could learn internal paths and environment settings, which may help in chaining with other flaws such as SQL injection.

What the attacker needed

No authentication required

The fix

The report recommends protecting the root folder with basic authentication or removing the files that cause the stack trace errors.

How it was found

  1. Request the last successful build log text endpoint on the affected host.
  2. Observe the environment variables and path information returned in the log output.
  3. Repeat against the last failed build log text and HTML endpoints to confirm the disclosure.

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.

Some web servers show extra technical details when something goes wrong or when a log page is opened. Here, a build log page revealed the server's internal folder paths and environment settings. That information is not secret enough to break in by itself, but it helps an attacker plan further attacks.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Andy Gill

View all

6 more disclosed reports, best first.

More from Homebrew

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.