Skip to content

[deep-review] C1: WindowsNodeClient leaks ex.Message to gateway, defeating SttCapability privacy invariant #341

Closed

Description

@codemonkeychris

Summary

The node-invoke dispatch wrapper in WindowsNodeClient catches capability exceptions and sends "Execution failed: {ex.Message}" back to the gateway. This silently violates the explicit privacy contract documented in SttCapability (and reasonably expected by other capabilities) that exception details must never propagate into wire responses, because exception messages can carry caller-language strings, file paths, or other host details that the capability deliberately strips from its successful responses.

Where

  • src/OpenClaw.Shared/WindowsNodeClient.cs:484 (event-shape dispatch)
  • src/OpenClaw.Shared/WindowsNodeClient.cs:1006 (req/res-shape dispatch)
  • The privacy invariant being defeated is in src/OpenClaw.Shared/Capabilities/SttCapability.cs (documented in code comments — never echo language string or exception messages into response).

Why it matters

A capability like SttCapability carefully avoids leaking the locale/exception text the user typed or system paths. The transport then catches an exception thrown anywhere in the capability and serializes its Message back over the wire, undoing the redaction. The gateway-side agent receives details the capability author considered sensitive.

This is a regression that no test would catch, because the test surface stops at the capability return value — not the transport wrapper.

Proposed fix

In both catch sites in WindowsNodeClient, wrap unexpected exceptions to a generic string ("capability execution failed") and log the detail to IOpenClawLogger.Error with the original exception. Capabilities that want to surface a meaningful error to the gateway should return NodeInvokeResponse.Error(...) themselves — never throw.

Add a unit test: a capability that throws an exception containing a sentinel string; assert the wire response does not include the sentinel.

Severity

Bug — privacy regression at the transport boundary.

Activity

  1. added
    bug
    on May 14, 2026
  2. shanselman commented on May 18, 2026

    @shanselman
    Collaborator

    Closing this one-off deep-review issue as consolidated, not necessarily fixed. The useful signal is preserved in #372: capability error privacy remains useful signal, but should be verified and fixed fresh. We will take these one at a time from #372 after verifying against current master instead of keeping the issue list flooded.

  3. locked as resolved and limited conversation to collaborators on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugsecurity

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions