Exposed Database Credentials via Directory Listing and Publicly A
A publicly accessible directory with listing enabled contained a downloadable compressed backup archive holding a configuration file with plaintext database credentials. An attacker could use those credentials to access all database data, including user PII, and attempt lateral movement.
During security research on a subdomain belonging to ETH Zurich, I found a publicly accessible directory with Directory Listing enabled. The directory contained a compressed backup archive that was freely downloadable without any authentication.
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 directory listing was left enabled on a user-hosted directory and access controls were applied only to individual file extensions, so a compressed archive containing the same sensitive files was not blocked.
Impact
An attacker with the valid database credentials could access all data stored in the database including user PII, attempt lateral movement within the internal network, and use exposed internal hostnames for further reconnaissance.
What the attacker needed
None
The fix
The issue was fixed by disabling directory listing globally, keeping backup files out of public paths, rotating exposed credentials, and applying access controls at the directory level rather than only on individual file extensions.
How it was found
- Find a subdomain belonging to the organisation.
- Discover a publicly accessible directory with directory listing enabled.
- Download a compressed backup archive from that directory without authentication.
- Extract the archive to reveal a configuration file with plaintext database 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 web server was showing a list of every file in one of its folders, like leaving a filing cabinet open with all the labels visible. One of those files was a backup archive that anyone could download, and inside it was a settings file with the database username and password written in plain text. With those details, someone could log in to the database and read or change everything stored there.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.