Local File Disclosure on the ████████ (https://████/) leads to the source code disclosure & DB credentials leak
A file handler on the site accepted a path parameter and returned any server-side file, including the web configuration file and application source code. An attacker could read database credentials and source code to further compromise the resource.
- Triaged in 3 days
- Fixed in 16 months
- Disclosed after 16 months
##Description I discovered another LFD on the https://████/ (virtual host on the █████ IP)
##POC https://█████/file.ashx?path=web.config will download the website configuration file. It exposes different DB credentials than in previous reports: ███
Similarly, attacker able to get content of any server-side file, such as source code of application: https://███/file.ashx?path=index.aspx
Impact
Source code & sensitive configuration data leakage. Attacker can use it to compromise the resource.
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 file handler trusted a user-supplied path and did not restrict it to an allowed directory or file list.
Impact
An attacker could read source code and sensitive configuration data, including database credentials, which could be used to compromise the resource.
What the attacker needed
None
How it was found
- Request the file handler with the path set to the web configuration file.
- Observe that the configuration file is downloaded and contains database credentials.
- Request the same handler with the path set to an application source file.
- Observe that the source code is 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 report has not been written yet. The Original tab links to the source.
A web page had a feature that took a file name from the address bar and sent back that file from the server. It did not check which files were allowed, so anyone could ask for private files such as the site's settings, which held database passwords.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.