High severityC#Sensitive Data ExposureMEDIUM confidence
PII PHI Exposure
Personal or protected health information (PII/PHI) is written to a log, console, or cookie (CWE-359).
Standards mapping
- CWE
- CWE-359: Exposure of Private Personal Information to an Unauthorized ActorCWE-532: Insertion of Sensitive Information into Log File
- OWASP Top 10
- A02:2021 - Cryptographic Failures
- OWASP ASVS
- V8.3.4 (L2)V7.1.1 (L2)
Vulnerable vs. safe
Flagged by this check
logger.LogInformation($"Patient record for {ssn}");Passes - the safe pattern
logger.LogInformation($"Processed {count} records");Why it matters & how to fix it
Personal or protected health information (PII/PHI) is written to a log, console, or cookie (CWE-359). This risks unauthorized exposure of regulated data (e.g. HIPAA PHI, GDPR personal data). Do not log or client-persist these fields; store them encrypted, mask them in output, and restrict access to authorized, audited paths.
References
Rule ID integsec.csharp.sensitive-data.pii-phi-exposure - 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