No default or weak passwords in config/docs
Why it matters
Example files and README docs are copied verbatim by developers setting up new environments. A .env.example containing a real-looking API key format like sk_test_51abc... trains developers to paste real keys into that pattern, and anyone who clones the repo might assume the example value is valid and try it. CWE-798 (Use of Hard-coded Credentials) and CWE-521 (Weak Password Requirements) both apply when examples provide credential values that normalize insecure patterns. OWASP A07 includes authentication failures caused by weak credential templates. An example with password: 'password' signals to every developer that weak passwords are acceptable.
Severity rationale
Low because default or weak passwords in examples cannot be exploited directly but normalize insecure credential choices and increase the likelihood that developers reuse them in real deployments.
Remediation
Replace every credential-like value in example files and documentation with an unmistakably fake placeholder. The placeholder must be obviously non-functional — not a realistic-format key that someone might try to use.
# .env.example — correct
DATABASE_URL=postgresql://YOUR_DB_USER:YOUR_DB_PASSWORD@localhost/YOUR_DB_NAME
STRIPE_SECRET_KEY=sk_test_YOUR_STRIPE_KEY_HERE
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
JWT_SECRET=YOUR_STRONG_RANDOM_SECRET_HERE
Acceptable placeholders: YOUR_X_HERE, CHANGEME, xxx_placeholder. Unacceptable: password, 12345, test, sk_test_51abc1234 (real-format). Audit every .env.example, docker-compose.yml, and README code block that contains a credential field.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Environment Security Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-798 — Use of Hard-coded Credentials
- cwe · CWE-521 — Weak Password Requirements
- owasp:2021 · A07 — Identification and Authentication Failures
Taxons
History
- 2026-04-18·v1.0.0·Initial import from environment-security·automated