Medium severityPythonSensitive Data ExposureMEDIUM confidence
Return Exception Detail To Client
Exception/stack-trace detail is returned to the client (CWE-209).
Standards mapping
- OWASP Top 10
- A05:2021 - Security Misconfiguration
- OWASP ASVS
- V14.3.2 (L1)
Vulnerable vs. safe
Flagged by this check
return jsonify({"error": str(e)})Passes - the safe pattern
return jsonify({"error": "Internal Server Error"}), 500Why it matters & how to fix it
Exception/stack-trace detail is returned to the client (CWE-209). Internal error messages leak file paths, queries, and stack frames that aid attackers. Return a generic error and a correlation ID; log the detail server-side only.
References
Rule ID integsec-python-return-exception-detail-to-client - 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