The vulnerability is a Server-Side Request Forgery (SSRF) in the openclaw npm package, caused by an insecure default SSRF policy for browser operations. The core of the issue lies in the resolveBrowserSsrFPolicy function, which was responsible for generating the SSRF policy. By default, it produced a permissive policy that allowed navigation to private networks.
This weak policy was then used by several functions that perform network requests, such as fetchCdpChecked, isChromeReachable, and getChromeWebSocketUrl. These functions are used for interacting with the Chrome DevTools Protocol (CDP) for browser automation. Because they inherited the permissive policy, they could be exploited to make requests to internal services and metadata endpoints on a private network.
The fix involved several changes. First, resolveBrowserSsrFPolicy was updated to generate a strict policy by default (dangerouslyAllowPrivateNetwork: false). Second, functions like fetchCdpChecked were modified to ensure they use a secure policy, while also making a specific exception to allow connections to the loopback address (127.0.0.1) for essential CDP communication. This ensures that the browser can still be controlled locally without re-introducing the SSRF vulnerability.