Skip to content

fix(desktop): harden diagnostics log scrubbing to redact URL credentials - #324

Merged
badbread merged 1 commit into
mainfrom
fix/desktop-diagnostics-scrub-hardening
Jul 20, 2026
Merged

fix(desktop): harden diagnostics log scrubbing to redact URL credentials#324
badbread merged 1 commit into
mainfrom
fix/desktop-diagnostics-scrub-hardening

Conversation

@badbread

@badbread badbread commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

Hardens the desktop diagnostics log scrubber (apps/desktop-flutter/lib/services/diagnostics_service.dart) so URL-embedded credentials are always redacted before capture:

  • scrub() gains a userinfo-redaction pattern (scheme://user:pass@host -> scheme://[REDACTED]@host).
  • attachPlayer's two capture sites (player error stream, verbose mpv log stream) now pre-scrub the raw text before handing it to log(), belt-and-suspenders alongside the scrub log() already applies to every message.

This closes a gap where a media-player error or verbose log line that echoes back the URL it was opening could carry an unredacted credential into the bounded diagnostics buffer and, from there, into an exported diagnostics file.

Addresses a privately-reported security advisory (GHSA-rpqp-22wr-p5gh) rather than a public issue — see the repo's private security-advisory process in SECURITY.md.

Verification

Not build-verified — the Flutter desktop client is built on a separate Windows host (winbuild) this session did not have access to; no flutter analyze/flutter test was run. The change is a self-contained, minimal edit to one file (a new regex-based String -> String transform plus two call sites now routing through it) with no new imports or API surface. Please run flutter analyze / the desktop test suite on winbuild before merging.

🤖 Generated with Claude Code

Add a URL-userinfo redaction pattern to DiagnosticsService.scrub() (and
pre-scrub the raw text at the two attachPlayer capture sites, belt-and-
suspenders) so a scheme://user:pass@host substring is always redacted before
it can reach the bounded diagnostics ring buffer or an exported log file.

Signed-off-by: badbread <badbread@users.noreply.github.com>
@badbread
badbread merged commit 9632565 into main Jul 20, 2026
6 checks passed
@badbread
badbread deleted the fix/desktop-diagnostics-scrub-hardening branch July 20, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant