High severityJavaScript / TypeScriptAuthentication & SecretsMEDIUM confidence
Hardcoded Secret
A credential or secret appears to be hardcoded in source.
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)V2.10.4 (L2)
Vulnerable vs. safe
Flagged by this check
const apiKey = "sk_live_51H8xExampleKey0000";Passes - the safe pattern
const apiKeyFromEnv = process.env.API_KEY;Why it matters & how to fix it
A credential or secret appears to be hardcoded in source. Move it to an environment variable or a secrets manager and rotate the exposed value.
References
Rule ID integsec-js-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 & SecretsInsecure Cookie Flags
- JavaScript / TypeScript - Authentication & SecretsJWT Algorithm None
- JavaScript / TypeScript - Authentication & SecretsJWT Decode Without Verify
- JavaScript / TypeScript - Authentication & SecretsTLS Verification Disabled
- Python - Authentication & SecretsDjango Hardcoded Secret Key