Medium severityJavaSensitive Data ExposureMEDIUM confidence
Exception Detail Exposure
Exception or stack-trace detail is exposed via printStackTrace or written back to the client (CWE-209).
Standards mapping
- CWE
- CWE-209: Generation of Error Message Containing Sensitive InformationCWE-200: Exposure of Sensitive Information to an Unauthorized Actor
- OWASP Top 10
- A05:2021 - Security Misconfiguration
- OWASP ASVS
- V7.1.1 (L2)V14.3.2 (L1)
Vulnerable vs. safe
Flagged by this check
e.printStackTrace();Passes - the safe pattern
logger.error("operation failed", e);Why it matters & how to fix it
Exception or stack-trace detail is exposed via printStackTrace or written back to the client (CWE-209). Internal paths, class names, and query fragments leak implementation details useful to an attacker. Log the full exception server-side through your logging framework, and return a generic error message plus a correlation ID to the caller.
References
Rule ID integsec-java-exception-detail-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