The vulnerability is a Cross-Site Request Forgery (CSRF) weakness in OpenClaw's browser control servers. These servers, which listen on loopback addresses (localhost), did not validate the 'Origin' or 'Referer' headers of incoming HTTP requests. This allowed a malicious website visited by a user to send requests to the local OpenClaw instance and perform unauthorized actions, such as opening tabs or modifying storage.
The patch introduces a middleware, browserMutationGuardMiddleware, which is now applied to the Express.js applications created in startBrowserBridgeServer and startBrowserControlServerFromConfig. This middleware inspects incoming requests for mutating HTTP methods (POST, PUT, PATCH, DELETE). If such a request is detected, it checks if it's a cross-origin request by examining the Origin, Referer, and Sec-Fetch-Site headers. If the request is identified as cross-origin, it is rejected with a 403 Forbidden status.
The vulnerable functions are the ones responsible for setting up these servers without the necessary CSRF protection. By adding the middleware, the patch secures these server setup functions, making them no longer vulnerable.