Summary
OpenClaw's manual Chutes OAuth login flow contains a state validation bypass that undermines its CSRF protection.
By tricking a user into pasting attacker-controlled OAuth callback data, an attacker can substitute credentials and persist tokens for unauthorized accounts.
Affected context
This vulnerability affects deployments of OpenClaw using the manual Chutes OAuth login flow, where users are instructed to copy and paste OAuth callback data into the application.
The issue occurs in flows that either fail to bind the OAuth state parameter to the user's session or do not verify that the pasted callback data corresponds to a legitimate, user-initiated authorization request.
Environments that rely on this manual copy-paste pattern and treat the pasted callback content as trusted input are at elevated risk.
Exploit preconditions
- Attack surface: User-facing OAuth login flow for Chutes within OpenClaw.
- Required access: Ability to communicate with the victim (e.g., phishing, in-app messages, chat) and to generate OAuth callback data for an attacker-controlled account.
- User interaction: The victim must be convinced to paste the attacker-provided OAuth callback data into the OpenClaw manual login interface.
- Trigger point: Processing of the pasted OAuth callback (code, state, or similar parameters) by the OpenClaw backend without correctly enforcing state/CSRF validation.
- Why exploitation is possible: The manual login flow either does not robustly validate the
stateparameter for authenticity and session binding, or treats the callback content as trusted, allowing an attacker's authorization response to be bound to the victim's session.
Why this happens
The core issue is a broken CSRF defense in an OAuth login flow, corresponding to CWE-352: Cross-Site Request Forgery (CSRF).
Normally, OAuth clients generate a per-request, session-bound state value and verify it on callback to ensure the response is tied to the user's genuine authorization request.
In this manual Chutes flow, the design relies on users pasting callback data and does not enforce strict state integrity and session binding.
As a result, attacker-crafted OAuth responses can be accepted as if they originated from the victim's own authorization request, allowing the attacker's account or tokens to be associated with the victim's authenticated session.
Potential impact
- Attacker-controlled account being linked to a victim's OpenClaw session.
- Credential substitution, where the victim unknowingly authenticates as an unauthorized or attacker-owned account.
- Long-lived token persistence for attacker accounts within the victim's environment.
- Unauthorized access to data and actions within OpenClaw under the guise of a legitimate user.
- Potential pivoting within the application or connected services using the compromised OAuth tokens.
General mitigation guidance
Effective mitigation focuses on strengthening CSRF defenses and eliminating trust in manually supplied callback data:
- Ensure OAuth
statevalues are cryptographically strong, unique per request, and bound to the user's session, rejecting any callback whose state does not match. - Avoid treating user-pasted callback data as inherently trustworthy; treat it as untrusted input that must pass the same state and session validation as standard redirect flows.
- Prefer secure-by-default OAuth integrations that rely on automatic redirect callbacks rather than manual copy-paste mechanisms, where feasible.
- Implement server-side checks that verify the callback parameters correspond to a legitimate, active authorization request initiated by the same user.
- Minimize the privileges attached to tokens and accounts authorized via such flows, following least-privilege principles to reduce impact if misuse occurs.
How teams detect issues like this
Detection typically combines review of authorization logic with targeted security assessments:
- Static analysis and code review: Examine OAuth client implementation for correct generation, storage, and verification of the
stateparameter and other CSRF tokens, particularly in manual or alternative login paths. - Flow analysis: Validate that every login and token-binding code path enforces state/session checks and does not rely on client-side behavior or user actions for security guarantees.
- Security testing: Perform targeted penetration testing of OAuth flows, including manual copy-paste flows, to attempt credential substitution and unauthorized token binding.
- Monitoring and logging: Log OAuth authorization requests and corresponding callback handling, including mismatches or missing state values, and alert on unusual patterns such as repeated binding of different accounts to the same user profile.

