Medium severityPythonSensitive Data ExposureMEDIUM confidence
Logging PII PHI
PII/PHI (e.g. SSN, DOB, card number, patient/medical record) is written to logs (CWE-359).
Standards mapping
- 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("Processing patient ssn=%s", ssn)Passes - the safe pattern
logger.info("Processing order %s", order_id)Why it matters & how to fix it
PII/PHI (e.g. SSN, DOB, card number, patient/medical record) is written to logs (CWE-359). This violates privacy expectations and HIPAA/PCI. Do not log personal or health data; redact, tokenize, or log a surrogate key.
References
Rule ID integsec-python-logging-pii-phi - 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