The vulnerability, identified as GHSA-m8wm-r5vq-qjpg, exists in OpenClaw's gateway component. The root cause is the improper caching of authentication credentials. The gateway's HTTP and WebSocket handlers would resolve the bearer authentication token from a SecretRef only once at startup. This configuration was then used for the lifetime of the server process.
Consequently, if the secret (e.g., the bearer token) was rotated or revoked, the gateway would not be aware of the change. It would continue to validate incoming requests against the stale, cached token, allowing an attacker to gain unauthorized access using the old, supposedly invalid token.
The vulnerability was present in two key functions:
createGatewayHttpServer: This function, responsible for handling standard HTTP requests to endpoints like /v1/* and /tools/invoke, used the stale authentication data.
attachGatewayUpgradeHandler: This function, responsible for handling WebSocket upgrade requests (e.g., for the canvas), also used the same stale authentication data.
The patch addresses this flaw by introducing a mechanism to re-resolve the authentication credentials on a per-request basis. A new function, getResolvedAuth, is introduced and called within the request/upgrade handlers of both createGatewayHttpServer and attachGatewayUpgradeHandler. This ensures that every incoming connection is authenticated against the most up-to-date secret, effectively mitigating the vulnerability by immediately honoring credential rotation.