Medium severityPHPSensitive Data ExposureMEDIUM confidence
Log Secret Variable
A secret or credential variable is written to a log/dump sink (CWE-532).
Standards mapping
- OWASP ASVS
- V7.1.1 (L2)V7.1.2 (L2)
Vulnerable vs. safe
Flagged by this check
error_log($password);Passes - the safe pattern
error_log("login attempt processed");Why it matters & how to fix it
A secret or credential variable is written to a log/dump sink (CWE-532). Secrets in logs are retained, shipped to aggregators, and widely readable. Remove the value from log statements or redact it before logging, and never log passwords, tokens, or full card/SSN values.
References
Rule ID integsec-php-log-secret-variable - 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 ExposureSecret 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