Medium severityJavaScript / TypeScriptSensitive Data ExposureMEDIUM confidence
Secret In Logs
A password, token, or secret is written to a log sink, where it can persist in plaintext and be exposed.
Standards mapping
- CWE
- CWE-532: Insertion of Sensitive Information into Log FileCWE-312: Cleartext Storage of Sensitive Information
- OWASP ASVS
- V7.1.1 (L2)V7.1.2 (L2)
Vulnerable vs. safe
Flagged by this check
console.log(user.password);Passes - the safe pattern
console.log("user authenticated");Why it matters & how to fix it
A password, token, or secret is written to a log sink, where it can persist in plaintext and be exposed. Redact or omit credentials from log output.
References
Rule ID integsec-js-secret-in-logs - 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 - Sensitive Data ExposureError Stack In Response
- JavaScript / TypeScript - Sensitive Data ExposurePII PHI In Logs
- JavaScript / TypeScript - Sensitive Data ExposureSensitive Data Client Storage
- JavaScript / TypeScript - Sensitive Data ExposureSensitive Data In URL Query
- Python - Sensitive Data ExposureFlask Traceback In Response
- Python - Sensitive Data ExposureHardcoded PII Literal