The vulnerability stemmed from two main issues in the OpenClaw dashboard. First, the macOS application, when opening the dashboard, constructed a URL that included the gateway authentication token and password as query parameters. The function GatewayEndpointStore.dashboardURL in apps/macos/Sources/OpenClaw/GatewayEndpointStore.swift was responsible for this insecure URL construction. This exposed sensitive credentials in the browser's address bar, history, and potentially in logs.
Second, the web-based Control UI would then take these credentials from the URL and persist the token in the browser's localStorage. The saveSettings function in ui/src/ui/storage.ts directly serialized the settings object, which contained the token, into localStorage. The loadSettings function would then load this token back into the application on subsequent visits. This created a persistent exposure of the admin token in script-readable storage, accessible to any malicious script that could achieve execution on the dashboard's origin.
The patch addresses these issues by:
- Modifying
GatewayEndpointStore.dashboardURL to pass the token via the URL fragment (#) instead of the query string, and completely removing the password from the URL.
- Changing
saveSettings and loadSettings in ui/src/ui/storage.ts to ensure the token is never persisted to localStorage and that any legacy tokens are scrubbed upon loading the application.