The analysis of the provided commit bc356cc8c2beaa747c71dd86cceab8f804699665 reveals a Server-Side Request Forgery (SSRF) vulnerability in the openclaw package. The root cause of the vulnerability lies in the createTargetViaCdp function located in extensions/browser/src/browser/cdp.ts.
The vulnerability description indicates that the webSocketDebuggerUrl is not properly validated. The code patch confirms this. Specifically, when the cdpUrl parameter passed to createTargetViaCdp is a WebSocket URL (e.g., starting with ws:// or wss://), the function would proceed to use this URL directly without checking if it complies with the application's SSRF policy. An attacker could exploit this by crafting a request with a malicious WebSocket URL, causing the application server to initiate a connection to an unintended and potentially malicious destination.
The patch addresses this vulnerability by adding a validation step. The line await assertCdpEndpointAllowed(opts.cdpUrl, opts.ssrfPolicy); is inserted to ensure that any direct WebSocket URL is first validated against the defined SSRF policy before being used. The associated test file changes also confirm this by adding a test case that asserts that a connection to a disallowed private network address is blocked, throwing an SsrFBlockedError.