Github, The Goldmine for P1s and P2s - Sensitive Information Exposure via Github by a Company Employee
A company employee published a bash file on GitHub containing PostgreSQL credentials for a host. An attacker could use these credentials to access the database if the port were open, but the port was closed at the time of testing.
Published on web.archive.org
Github Leaks - We have seen a lot of people in the bug bounty community tweeting about their Github Findings and getting paid out four figs for their reports. That’s awesome and Kudos to them for that but, if we take a step back and take a look, there aren’t many blogs on Github Findings.
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 employee committed a configuration file containing database credentials to a public GitHub repository.
Impact
The credentials could allow database access if the port were open, but the port was closed at the time of testing; the company noted the port is opened monthly for maintenance, which would make the credentials exploitable then.
What the attacker needed
Public GitHub repository; credentials committed by an employee; database port reachable
How it was found
- Search GitHub for the target domain using basic dorks.
- Refine the search to exclude test, staging, and other false positives.
- Filter results to bash files and search for PostgreSQL.
- Sort by recently indexed and inspect a bash file containing credentials.
- Verify the author is related to the target company via LinkedIn.
- Attempt to connect to the database using the found credentials.
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 developer accidentally put a username and password for a database into a public code repository. Anyone could see them. If the database were reachable from the internet, an attacker could log in and access data. In this case, the database port was closed, so the credentials could not be used immediately.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.