Local File Disclosure on the █████ (https://████████.edu/) leads to the full source code disclosure and credentials leak
A file handler on an education site accepted a path parameter and returned any server-side file, including the web configuration and application source code. An attacker could read database credentials and source code, which the report says could be used to compromise the resource.
- Triaged in 8 hours
- Fixed in 6 months
- Disclosed after 4.8 years
##Description
During poking around ██████.00/24 range - ██████████ looking for the Cisco devices, I came across ███ which resolved to the https://███████.edu/
While it's a not .mil host, it's likely related to the DoD since it hosted in the DoD-controlled ASN.
I discovered few critical vulnerabilities here, one of them is LFD (local file disclosure).
##POC https://██████.edu/file.ashx?path=web.config will download the website configuration file. It exposes the DB credentials: ███
Similarly, attacker able to get content of any server-side resource, such as source code of application: https://███.edu/file.ashx?path=UserAccountJSON.aspx.cs
Impact
Source code & DB credentials 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 took a user-supplied path and read the file without checking that it stayed inside an allowed directory or that the requester was authorised.
Impact
Source code and database credentials could be leaked, which the report says an attacker could use to compromise the resource.
What the attacker needed
Reachable file handler endpoint
How it was found
- Find the file handler endpoint on the site.
- Request the web configuration file through the path parameter.
- Observe the configuration file is downloaded and contains database credentials.
- Request an application source file through the same parameter to read code.
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 often has a small program that hands files to visitors, such as images or downloads. Here that program trusted a value in the address bar that named which file to send, so anyone could ask for private files kept on the server, like settings and program code. Those files held the password for the database, which is the store of user data.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.