[Repo Assist] fix(security): stop echoing ex.Message into node capability error responses#291
Draft
github-actions[bot] wants to merge 2 commits intomasterfrom
Conversation
…ponses Exception messages in node capability error responses can contain sensitive data: file paths, device names, API key prefixes, environment variable values, or command output fragments. These responses flow back through the gateway to the chat agent and may be persisted in recent activity / support bundles. The new SttCapability (PR #288) explicitly documents the privacy invariant: "never echo raw exception text into the response; full detail stays in the local log only". This commit applies the same rule to the existing capabilities that were not yet following it. Affected capabilities: - SystemCapability: system.run execution errors (can expose env vars/output), V2 approval handler exceptions, execApprovals.set policy update errors - CameraCapability: camera.list / camera.snap / camera.clip errors (can expose device names and paths) - ScreenCapability: screen.snapshot / screen.record errors (can expose paths) - LocationCapability: location.get errors (can expose system paths) Not changed: - TtsCapability: already fixed by the in-flight PR #288 - BrowserProxyCapability: intentionally includes connectivity context (port/host reachability) which is user-facing diagnostic data - CanvasCapability: mixed — some errors are intentional UI feedback Exception detail is preserved in Logger.Error calls that were already present, so diagnostics remain available in local logs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update capability exception tests to verify generic node responses after raw exception details are kept in local logs only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Exception messages in node capability error responses can contain sensitive data — file paths, device names, API key prefixes, environment variable values, or command output fragments. These responses flow back through the gateway to the chat agent and may be persisted in recent activity / support bundles.
The new
SttCapability(PR #288) explicitly documents the privacy invariant:This PR applies the same rule to existing capabilities that were not yet following it.
Root cause
When these capabilities were first written, echoing
ex.Messageinto error strings was a convenient shortcut for debugging. The pattern became inadvertently inconsistent — some capabilities leak exception text, others don't. PR #288 surfaced this by documenting the invariant for new code.Changes
SystemCapability.cssystem.runexecution errors; V2 approval handler exception reason;execApprovals.setpolicy update errorCameraCapability.cscamera.list,camera.snap,camera.clipScreenCapability.csscreen.snapshot,screen.recordLocationCapability.cslocation.getException detail is preserved in the
Logger.Errorcalls already present on each path, so local diagnostics are unaffected.Not changed
TtsCapability— already fixed by in-flight PR audio: Whisper STT + Piper TTS as MCP-callable node capabilities #288 (would create a merge conflict)BrowserProxyCapability— intentionally includes connectivity context (port/host reachability); these are user-facing diagnostics, not opaque exceptionsCanvasCapability— mixed; some error strings are intentional UX feedback and need separate analysisTest Status
OpenClaw.Shared.Tests --no-restoreOpenClaw.Tray.Tests --no-restorebuild.ps1