Summary
OpenClaw's CDP /json/version WebSocket endpoint exposes a server-side request forgery (SSRF) weakness by returning a webSocketDebuggerUrl field that is not properly validated.
An attacker who can interact with this endpoint may coerce the server into establishing WebSocket connections to arbitrary second-hop hosts, potentially reaching internal or otherwise untrusted network targets.
Affected context
This vulnerability affects OpenClaw deployments that expose the CDP /json/version WebSocket endpoint to users or automation.
In these environments, the endpoint returns a webSocketDebuggerUrl that the server or dependent tooling may trust and use to establish backend connections.
Because the URL is not constrained to expected or safe destinations, it becomes possible to direct server-initiated WebSocket traffic toward attacker-chosen hosts, including internal services or external systems that should not be reachable from the application.
Exploit preconditions
- Attack surface: The CDP
/json/versionWebSocket endpoint reachable over HTTP/HTTPS. - Required access: Ability to send requests to the
/json/versionendpoint and influence or consume thewebSocketDebuggerUrlvalue. - Trigger point: Use of the unvalidated
webSocketDebuggerUrlby the server or integrated tooling to initiate a WebSocket connection. - Why exploitation is possible: The application returns and/or uses a WebSocket URL from an untrusted context without enforcing host, scheme, or network boundary checks, aligning with SSRF behavior where server-side network capabilities are exposed to the client.
Why this happens
The root cause lies in treating the webSocketDebuggerUrl as trustworthy without validating its destination.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where user-controlled or untrusted input is used to drive server-side outbound connections.
The behavior is also related to CWE-601: Open Redirect, since a URL field is effectively used as a redirector or pointer to arbitrary locations.
By not constraining the URL to approved origins or network ranges, the server acts as an unwilling proxy, allowing attackers to reuse its network position to reach otherwise restricted targets.
Potential impact
- Use of the server as a pivot to access internal network services that are not directly exposed to the internet.
- Interaction with metadata services or management interfaces that rely on network isolation for security.
- Discovery of internal hosts, ports, and services through targeted connection attempts.
- Potential exploitation of internal applications if they contain additional vulnerabilities reachable via the forged WebSocket connection.
- Abuse of the server's IP reputation to contact external systems in a way that appears to originate from a trusted host.
General mitigation guidance
Effective mitigation typically focuses on reducing the trust placed in externally influenced URLs and tightening outbound network behavior:
- Constrain
webSocketDebuggerUrlto known-good schemes, hosts, and paths, and reject or sanitize any values that deviate from these allowlists. - Enforce network-level egress controls so that application servers can only initiate outbound connections to explicitly permitted destinations.
- Introduce strict validation logic on CDP-related endpoints, ensuring any returned endpoint URLs are constructed server-side from trusted configuration rather than user-influenced data.
- Separate sensitive internal services onto network segments that are not reachable from application tiers, even if SSRF-style flaws occur.
- Apply least-privilege principles for application network access, avoiding broad outbound connectivity wherever feasible.
How teams detect issues like this
Organizations can detect and monitor for SSRF patterns involving WebSocket endpoints through multiple approaches:
- Static analysis: Search for code paths where user-controlled or external input is used to build URLs that drive outbound connections, particularly in CDP or debugger-related features.
- Code review: Flag any logic that reflects URLs back to clients or uses response fields like
webSocketDebuggerUrlwithout host and scheme validation; reviewers should look for absence of allowlists or normalization. - Dynamic testing: Use security testing tools to attempt directing
webSocketDebuggerUrl(or equivalent fields) toward controlled endpoints and observe whether the server initiates outbound connections. - Operational monitoring: Inspect network logs and outbound firewall telemetry for unexpected connections originating from application servers to unusual or internal-only destinations.
- Policy enforcement: Incorporate SSRF-focused checks into CI/CD pipelines, requiring explicit justification when code introduces new outbound connection capabilities.

