The vulnerability exists in the authentication mechanism for OpenClaw's canvas routes (/__openclaw__/canvas/* and /__openclaw__/a2ui/*). The system was designed with a trusted-host, loopback-first model. However, for deployments where the canvas is exposed to a wider network, the authentication was insufficient.
The root cause was an IP-based authentication fallback. The authorizeCanvasRequest function would allow access to canvas routes without a token if the request's IP address matched the IP of an already connected and authorized 'node' WebSocket client. This was implemented in the hasAuthorizedNodeWsClientForIp function. An attacker on the same local network, or in any environment where they might share an IP address with a legitimate node client (e.g., behind the same NAT), could send requests to the canvas routes and be granted access, bypassing authentication.
Furthermore, the resolveGatewayClientIp function had a weakness where it could incorrectly identify a request's origin. If a request came from a trusted proxy but was missing the x-forwarded-for header, the function would fall back to using the proxy's own IP as the client IP. This could cause an external request to be treated as local and trusted, exacerbating the issue.
The patches address this by completely removing the IP-based fallback mechanism. The fix, implemented in commit c45f3c5b004c8d63dc0e282e2176f8c9355d24f1, introduces a session-capability token system. Now, an authorized node is given a unique, short-lived capability token (oc_cap) which must be included in all subsequent requests to canvas routes. This ensures that only the client holding the token can access these routes, effectively hardening the authentication and preventing unauthorized access in mixed-trust deployments.