The vulnerability lies in the manual OAuth flow for Chutes, where the application could bypass state validation. The root cause is in the parseOAuthCallbackInput function within src/agents/chutes-oauth.ts. Previously, this function would accept a bare authorization code pasted by the user. When it received just the code, it would skip the crucial step of validating the state parameter returned by the OAuth provider. The state parameter is a CSRF token designed to prevent credential substitution attacks. By not validating it, an attacker could generate an authorization code for their own account, trick a victim into pasting it into the OpenClaw application, and have the application link the attacker's Chutes account to the victim's OpenClaw session.
The patch addresses this by removing the code path that accepts a bare authorization code. Now, parseOAuthCallbackInput requires the full redirect URL, from which it extracts both the code and the state. It then correctly validates that the received state matches the expected state that was generated at the beginning of the login flow.
The function loginChutes in src/commands/chutes-oauth.ts is the entry point for this vulnerable manual flow. It prompts the user for the callback data and calls parseOAuthCallbackInput. Therefore, both loginChutes and parseOAuthCallbackInput are critical functions to monitor for this vulnerability.