Skip to content

[Repo Assist] fix(security): stop echoing ex.Message into node capability error responses#291

Draft
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/fix-capability-exception-message-leaks-2026-05-07-212dee5478040ba5
Draft

[Repo Assist] fix(security): stop echoing ex.Message into node capability error responses#291
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/fix-capability-exception-message-leaks-2026-05-07-212dee5478040ba5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 7, 2026

🤖 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:

"Never echo raw exception text into the response; full detail stays in the local log only."

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.Message into 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

File Locations fixed
SystemCapability.cs system.run execution errors; V2 approval handler exception reason; execApprovals.set policy update error
CameraCapability.cs camera.list, camera.snap, camera.clip
ScreenCapability.cs screen.snapshot, screen.record
LocationCapability.cs location.get

Exception detail is preserved in the Logger.Error calls 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 exceptions
  • CanvasCapability — mixed; some error strings are intentional UX feedback and need separate analysis

Test Status

Suite Result
OpenClaw.Shared.Tests --no-restore ✅ exit 0
OpenClaw.Tray.Tests --no-restore ✅ exit 0
build.ps1 ⚠️ Windows-only — not runnable in this Linux CI environment. The change is a pure string simplification with no logic changes.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant