1 Hard-Coded Keys and Keys in Source Control
Cryptographic keys hard-coded in source code or committed to version control are one of the most common and easily exploitable security failures. Git history is permanent — even deleted files remain accessible.
Vulnerable patterns:
# Hard-coded in source (NEVER do this)
AES_KEY = b"mysupersecretkey16"
JWT_SECRET = "my-jwt-secret-key"
API_KEY = "sk_live_abcdef123456"// In JavaScript config file
const config = {
stripeKey: "sk_live_AbCdEfGhIjKlMnOp", // Committed to public repo!
dbPassword: "admin123"
};Git history exposure:
# Key "deleted" in latest commit is still visible
git log --all --full-history -- secrets.py
git show abc123:secrets.py # Key is still there!Automated scanners (GitGuardian, truffleHog) continuously monitor public repositories and identify exposed secrets within seconds of a commit.
Key rotation absence: Even if a key is not in source control, never rotating keys means a single compromise is permanent. Keys should have defined lifetimes.