High severityPythonAuthentication & SecretsMEDIUM confidence
Hardcoded Secret
A credential appears to be hardcoded in source (CWE-798).
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)V2.10.4 (L2)
Vulnerable vs. safe
Flagged by this check
api_key = "sk_live_1a2b3c4d5e6f7g8h"Passes - the safe pattern
api_key = os.environ["API_KEY"]Why it matters & how to fix it
A credential appears to be hardcoded in source (CWE-798). Hardcoded secrets leak via version control and binaries. Load secrets from environment variables or a secrets manager (e.g. os.environ, AWS Secrets Manager, Vault) and rotate any value that was committed.
References
Rule ID integsec-python-hardcoded-secret - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Authentication & SecretsHardcoded JWT Secret
- JavaScript / TypeScript - Authentication & SecretsHardcoded Secret
- JavaScript / TypeScript - Authentication & SecretsInsecure Cookie Flags
- JavaScript / TypeScript - Authentication & SecretsJWT Algorithm None
- JavaScript / TypeScript - Authentication & SecretsJWT Decode Without Verify
- JavaScript / TypeScript - Authentication & SecretsTLS Verification Disabled