What AuditX checks
The scan requests /.env at the root of your site and reads the start of the response. It fails when the server answers with a success status (2xx), the response is not an HTML page, and it contains a line shaped like NAME=value with an upper-case name. Anything else passes, including a redirect, which the scan does not follow. If the request never completes, the check is shown as not measured and is left out of the score. It looks only at /.env: other files such as .env.local or backup copies are not requested.
Why it matters
A .env file usually holds database passwords, API keys and other secrets. Anyone who can open the address in a browser can copy them, and bots scan the web for this file all day.
Leaked keys let an attacker use your database, mail account or payment tools. Blocking the file afterwards is not enough on its own, because the secrets may already have been copied.
How to fix it
- Move the .env file out of the folder your web server publishes, so no URL can reach it.
- If it has to stay, add a server rule that denies requests for dotfiles. Check by opening yourdomain.com/.env: you should see an error, not the file.
- Treat every value in the exposed file as compromised. Change the passwords and regenerate the API keys, then update your site to use the new ones.
- Check your server and access logs for requests to /.env to see whether anyone else fetched it.
# nginx
location ~ /\.(?!well-known) {
deny all;
}
Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.
Scan my site