---
title: "WEB-EXP-002 Environment or Secrets File Exposed"
canonical: https://openvapt.com/checks/WEB-EXP-002.html
html: https://openvapt.com/checks/WEB-EXP-002.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# WEB-EXP-002 Environment or Secrets File Exposed

Checks whether .env and similar configuration files can be downloaded.

- Domain: Web Apps
- Severity: Critical
- Control category: Information Exposure
- Fix effort: medium
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- CIS Controls v8: 3.3
- NIST CSF 2.0: PR.AA-05, PR.DS-01
- CWE: CWE-538, CWE-260
- OWASP Top 10 2021: A05:2021
- OWASP ASVS 4.0.3: 14.3.2, 2.10.4
- OWASP WSTG v4.2: WSTG-CONF-04
- NIST SP 800-53 Rev. 5: CM-7, SC-28

## Why It Matters

Framework .env files hold database passwords, mail credentials, encryption keys and API tokens. Downloading one usually means full compromise of the application and its data.

## How It Detects

Requests /.env, /.env.production, /config.php.bak and /wp-config.php.bak. A non-HTML 200 response containing typical key=value secrets (DB_, APP_KEY, DB_PASSWORD) confirms exposure. Contents are redacted in the report.

## How to Fix

Move secrets out of the web root, block dot-files at the web server, delete backup copies, then rotate every secret in the file because it must be treated as leaked.

## How to Verify

```
curl -s -o /dev/null -w '%{http_code}' https://<site>/.env  should print 403 or 404.
```

## Learn the Theory

- [P6 Information Exposure and Misconfiguration](https://openvapt.com/academy/p6.md)

## References

- [OWASP Secrets Management Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/web/exposure.go

Run it: `openvapt scan --only WEB-EXP-002`. Read it offline: `openvapt explain WEB-EXP-002`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/WEB-EXP-002.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
