openclaw-windows-node icon indicating copy to clipboard operation
openclaw-windows-node copied to clipboard

[deep-review] C2: NodeService.ShowToast bypasses user sound preferences for capture/record toasts

Open codemonkeychris opened this issue 6 months ago • 1 comments

Summary

There are two ShowToast implementations in the tray with divergent behaviour. App.ShowToast honours the user's sound preference (None/Subtle/Default) and a 30-second deduplication window. NodeService.ShowToast does neither — it just fires ToastContentBuilder().Show(). Capture/record paths route through NodeService.ShowToast, so screen-record / camera-clip / camera-blocked / capture-complete toasts ignore the user's sound setting.

Where

  • Divergent: src/OpenClaw.Tray.WinUI/App.xaml.cs:3823 (App.ShowToast) vs src/OpenClaw.Tray.WinUI/Services/NodeService.cs:1786 (NodeService.ShowToast)
  • Callers using the wrong path:
    • Toast_ScreenCaptured — NodeService.OnScreenCapture (~line 1367)
    • Toast_ScreenRecordingComplete — NodeService.OnScreenRecord (~line 1402)
    • Toast_CameraBlocked — NodeService.OnCameraSnap/OnCameraClip (~lines 1430, 1465)

Why it matters

These toasts fire on privacy-sensitive operations (screen capture, camera). A user who silenced toasts because they're in a meeting or recording video gets unexpected sound. Worse: the toasts fire on attacker-controllable triggers (any screen.snapshot succeeds throttled-once-per-10s).

Proposed fix

Delete NodeService.ShowToast. Route capture/record toasts through App.ShowToast (or equivalent helper that honours preferences and dedup).

Add a regression test: set sound preference to None, fire a capture, assert no PlaySound invocation (or use a mockable toast service and assert the routing).

Note on root cause

This is one of several findings where copy/paste in NodeService diverged from the original in App. Filing a structural duplication issue separately to catalog the broader pattern.

Severity

Bug — privacy/UX regression visible on every screen-capture invocation.

codemonkeychris avatar May 13 '26 23:05 codemonkeychris

Picking this up. Will remove NodeService.ShowToast and route capture/record toasts through App.ShowToast so sound preferences and deduplication are honoured.

AlexAlves87 avatar May 14 '26 07:05 AlexAlves87