Detects fail-open insecure defaults (hardcoded secrets, weak auth, permissive security) that allow apps to run insecurely in production. Use when auditing security, reviewing config management, or analyzing environment variable handling.
Finds fail-open vulnerabilities where apps run insecurely with missing configuration. Distinguishes exploitable defaults from fail-secure patterns that crash safely.
SECRET = env.get('KEY') or 'default' → App runs with weak secretSECRET = env['KEY'] → App crashes if missingDo not use this skill for:
test/spec/__tests__/.example, .template, .sample suffixes)When in doubt: trace the code path to determine if the app runs with the default or crashes.
Follow this workflow for every potential finding:
Determine language, framework, and project conventions. Use this information to further discover things like secret storage locations, secret usage patterns, credentialed third-party integrations, cryptography, and any other relevant configuration. Further use information to analyze insecure default configurations.
Example
Search for patterns in **/config/, **/auth/, **/database/, and env files:
getenv.*\) or ['"], process\.env\.[A-Z_]+ \|\| ['"], ENV\.fetch.*default:password.*=.*['"][^'"]{8,}['"], api[_-]?key.*=.*['"][^'"]+['"]DEBUG.*=.*true, AUTH.*=.*false, CORS.*=.*\*MD5|SHA1|DES|RC4|ECB in security contextsTailor search approach based on discovery results.
Focus on production-reachable code, not test fixtures or example files.
For each match, trace the code path to understand runtime behavior.
Questions to answer:
Determine if this issue reaches production:
If production config provides the variable → Lower severity (but still a code-level vulnerability) If production config missing or uses default → CRITICAL
Example report:
Finding: Hardcoded JWT Secret Fallback
Location: src/auth/jwt.ts:15
Pattern: const secret = process.env.JWT_SECRET || 'default';
Verification: App starts without JWT_SECRET; secret used in jwt.sign() at line 42
Production Impact: Dockerfile missing JWT_SECRET
Exploitation: Attacker forges JWTs using 'default', gains unauthorized access
Fallback Secrets: SECRET = env.get(X) or Y
→ Verify: App starts without env var? Secret used in crypto/auth?
→ Skip: Test fixtures, example files
Default Credentials: Hardcoded username/password pairs
→ Verify: Active in deployed config? No runtime override?
→ Skip: Disabled accounts, documentation examples
Fail-Open Security: AUTH_REQUIRED = env.get(X, 'false')
→ Verify: Default is insecure (false/disabled/permissive)?
→ Safe: App crashes or default is secure (true/enabled/restricted)
Weak Crypto: MD5/SHA1/DES/RC4/ECB in security contexts → Verify: Used for passwords, encryption, or tokens? → Skip: Checksums, non-security hashing
Permissive Access: CORS *, permissions 0777, public-by-default
→ Verify: Default allows unauthorized access?
→ Skip: Explicitly configured permissiveness with justification
Debug Features: Stack traces, introspection, verbose errors → Verify: Enabled by default? Exposed in responses? → Skip: Logging-only, not user-facing
For detailed examples and counter-examples, see examples.md.