Medium severityJavaSensitive Data ExposureMEDIUM confidence
Log Sensitive Data
A secret or PII/PHI value (password, token, SSN, DOB, card number, MRN, patient/diagnosis data, etc.) is written to a log or console stream (CWE-532/CWE-359).
Standards mapping
- CWE
- CWE-532: Insertion of Sensitive Information into Log FileCWE-359: Exposure of Private Personal Information to an Unauthorized Actor
- OWASP Top 10
- A02:2021 - Cryptographic Failures
- OWASP ASVS
- V7.1.1 (L2)V8.3.4 (L2)
Vulnerable vs. safe
Flagged by this check
logger.info("user password=" + password);Passes - the safe pattern
logger.info("user id=" + userId);Why it matters & how to fix it
A secret or PII/PHI value (password, token, SSN, DOB, card number, MRN, patient/diagnosis data, etc.) is written to a log or console stream (CWE-532/CWE-359). Logs are broadly readable and often shipped off-host, exposing HIPAA-protected and personal data. Never log secrets or PII; log a non-reversible identifier instead, and mask/redact sensitive fields.
References
Rule ID integsec-java-log-sensitive-data - 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