The vulnerability exists in the mechanism used by OpenClaw to authenticate to the Chrome DevTools Protocol (CDP) endpoint over a loopback connection. The core issue, located in src/browser/extension-relay.ts, is that the system would use its main, high-privilege gateway authentication token as a bearer token for these local probes.
The exploitation path is as follows:
- The
resolveGatewayAuthToken function would fetch the raw OPENCLAW_GATEWAY_TOKEN.
- The
relayAuthTokenForUrl function would incorrectly approve the use of this token for any request to a loopback address (e.g., 127.0.0.1), without verifying that an OpenClaw service was actually listening on the target port.
- The
getChromeExtensionRelayAuthHeaders function would then create an x-openclaw-relay-token HTTP header containing this sensitive token.
- A higher-level function, such as
fetchChromeVersion, would make an HTTP request to probe a CDP port (e.g., http://127.0.0.1:9222/json/version), sending the header with the gateway token.
An attacker with the ability to run a process on the same machine could predict or cause OpenClaw to probe a specific port they are listening on. The attacker's process would then receive the probe request and simply read the gateway token from the x-openclaw-relay-token header, resulting in a local privilege escalation.
The patch addresses this by ceasing the use of the raw gateway token for probes. Instead, it generates a derived, port-specific HMAC-based token. It also ensures that tokens are only generated for ports that are confirmed to be running an authenticated OpenClaw relay server.