security(reporting): scrub PII (host:port, emails) from crash-report stack traces #294

Closed
opened 2026-07-04 06:46:30 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-04 06:46:30 +00:00 (Migrated from github.com)

Phase-3 review finding (HIGH/security). DiagnosticsCollector.kt:70 captures throwable?.stackTraceToString() verbatim into DebugReport.toSubmissionPayload()/toStorageJson() with NO PII scrubbing. Jakarta/Angus Mail + java.net exceptions embed server hostnames (ConnectException: Failed to connect to imap.example.com/1.2.3.4:993) and auth failures can echo the username/email. Violates the hard PII-free-reports constraint; crash reports auto-surface at startup (#255). Fix: scrub the stack trace (strip host:port tokens + email-matching substrings; or keep only class+frames, drop messages) before it enters the report. Add a unit test asserting hosts/emails are removed. (The logs/accounts/settings fields are already clean — this is the one unscrubbed free-text field.)

Phase-3 review finding (HIGH/security). `DiagnosticsCollector.kt:70` captures `throwable?.stackTraceToString()` verbatim into `DebugReport.toSubmissionPayload()`/`toStorageJson()` with NO PII scrubbing. Jakarta/Angus Mail + java.net exceptions embed **server hostnames** (`ConnectException: Failed to connect to imap.example.com/1.2.3.4:993`) and auth failures can echo the **username/email**. Violates the hard PII-free-reports constraint; crash reports auto-surface at startup (#255). **Fix:** scrub the stack trace (strip host:port tokens + email-matching substrings; or keep only class+frames, drop messages) before it enters the report. Add a unit test asserting hosts/emails are removed. (The logs/accounts/settings fields are already clean — this is the one unscrubbed free-text field.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#294