Information Disclosure Due To exposed .env file (Directory Listing) at ████████
A .env file was publicly accessible on the server, exposing application configuration including database and email credentials. An attacker could use these secrets to access the database or email services.
Originally disclosed on HackerOne
- Disclosed after 6 days
A .env file was discovered on the server at ████, exposing sensitive application configurations, including database credentials, email settings, and more. This information could allow an attacker to gain unauthorized access to critical systems and services.
Steps to Reproduce:
- Open a web browser.
- Navigate to ████████.
- The .env file content is displayed, revealing sensitive information.
PoC Video Link: ██████
Impact
The exposed .env file could lead to multiple security threats, including but not limited to:
Unauthorized database access using DB_HOST, DB_USERNAME, and DB_PASSWORD. Compromise of email services via MAIL_USERNAME and MAIL_PASSWORD. Ability to access or manipulate other connected services.
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 web server was misconfigured to serve dotfiles or the .env file was placed in a publicly accessible directory without access restrictions.
Impact
The exposed credentials could allow unauthorised database access, compromise of email services, and access to other connected services.
What the attacker needed
None
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 .env file is a plain text file that stores secret settings for an application, such as database passwords. If it is left on a public web server, anyone who guesses the file name can read those secrets. Here the file was reachable directly in a browser, so the secrets were exposed.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.