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

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

Open codemonkeychris opened this issue 6 months ago • 1 comments

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.

codemonkeychris avatar May 13 '26 23:05 codemonkeychris

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.

shanselman avatar May 18 '26 00:05 shanselman