Finding
PR #1696 generated a repository-wide exception rewrite that replaced many f"...{exc}" log messages with static text plus exc_info=True. That is not a complete CWE-532 mitigation: Python traceback rendering still includes the exception type/value, so provider responses, connection strings, paths, or other sensitive values can remain in the log sink.
The broad sweep has therefore been removed from #1696. The public tool-response leak has a bounded repair there; logging confidentiality needs its own sink-aware owner rather than a generated blanket rule.
A CodeRabbit outside-diff finding on backend/scripts/import_fixtures.py also confirms a real raw-exception logging site. Other former #1696 paths included mail import/workers, runner connectivity, email endpoints, and LLM service logging. Those sites must be evaluated by actual data flow and log audience, not by string-pattern replacement alone.
Required contract
Define a shared structured exception telemetry contract that preserves operational correlation without logging raw exception values by default. Candidate evidence fields include exception class, stable traceback/location fingerprint, operation code, and bounded non-secret identifiers. Full traceback/value capture, when genuinely required, must be explicitly classified, access-controlled, retained appropriately, and tested against representative secret-bearing exceptions.
Do not assume exc_info=True is redacted. Do not suppress all diagnostics either.
Acceptance
- inventory production exception-log sinks and their trust/retention boundary;
- RED tests inject representative API keys/tokens, connection strings, provider response text, and internal paths and assert they do not appear in normal production logs;
- structured correlation evidence remains sufficient for RCA;
- no public/API response behavior is changed accidentally;
- security/operations doctoring records the chosen policy and exceptions;
- hosted security tests run on the final exact head.
References: CWE-532; OWASP Logging Cheat Sheet. Refs #1696.
Finding
PR #1696 generated a repository-wide exception rewrite that replaced many
f"...{exc}"log messages with static text plusexc_info=True. That is not a complete CWE-532 mitigation: Python traceback rendering still includes the exception type/value, so provider responses, connection strings, paths, or other sensitive values can remain in the log sink.The broad sweep has therefore been removed from #1696. The public tool-response leak has a bounded repair there; logging confidentiality needs its own sink-aware owner rather than a generated blanket rule.
A CodeRabbit outside-diff finding on
backend/scripts/import_fixtures.pyalso confirms a real raw-exception logging site. Other former #1696 paths included mail import/workers, runner connectivity, email endpoints, and LLM service logging. Those sites must be evaluated by actual data flow and log audience, not by string-pattern replacement alone.Required contract
Define a shared structured exception telemetry contract that preserves operational correlation without logging raw exception values by default. Candidate evidence fields include exception class, stable traceback/location fingerprint, operation code, and bounded non-secret identifiers. Full traceback/value capture, when genuinely required, must be explicitly classified, access-controlled, retained appropriately, and tested against representative secret-bearing exceptions.
Do not assume
exc_info=Trueis redacted. Do not suppress all diagnostics either.Acceptance
References: CWE-532; OWASP Logging Cheat Sheet. Refs #1696.