Summary
OpenClaw before 2026.3.31 lacks browser-origin validation on HTTP operator endpoints when running in trusted-proxy mode, enabling cross-site request forgery (CSRF).
In deployments where a browser is used to access OpenClaw through a trusted proxy, an attacker can cause a victim's browser to send unintended, authenticated requests to HTTP operator endpoints and perform unauthorized actions.
Affected context
This vulnerability affects OpenClaw instances that:
- Are deployed in trusted-proxy mode, where HTTP requests are considered authenticated or trusted based on proxy headers or network location.
- Expose HTTP operator endpoints that perform state-changing or administrative actions.
- Are accessed from a browser that maintains session state (e.g., cookies, bearer tokens, or client certificates).
In this context, OpenClaw does not enforce browser-origin or anti-CSRF protections, so the application cannot distinguish legitimate user actions from forged cross-site requests.
Exploit preconditions
- Attack surface: HTTP operator endpoints in OpenClaw deployments reachable via a browser through a trusted proxy.
- Required access:
- The victim must be authenticated or implicitly trusted to use the operator endpoints (e.g., via session cookies, SSO, or network trust).
- The attacker needs the ability to get the victim to load attacker-controlled web content (e.g., a malicious website, phishing email link, or injected iframe).
- Trigger point:
- The victim's browser automatically sends authenticated requests (including cookies or headers) to OpenClaw's HTTP operator endpoints when visiting attacker-controlled content that embeds cross-site requests.
- Why exploitation is possible:
- In trusted-proxy mode, OpenClaw relies on proxy trust rather than enforcing origin or CSRF token checks.
- The application accepts state-changing requests from browsers without requiring proof that the request originated from the legitimate OpenClaw UI.
Why this happens
The core issue is the lack of CSRF defenses for sensitive HTTP operator endpoints in browser-accessible contexts.
Under CWE-352, CSRF occurs when a web application:
- Relies on ambient browser authentication (cookies, auth headers) for sensitive operations, and
- Fails to tie those operations to a verifiable user interaction from the legitimate origin.
In trusted-proxy mode, OpenClaw trusts the incoming requests based on infrastructure assumptions but does not validate browser-origin metadata (such as Origin/Referer headers) nor require anti-CSRF tokens or double-submit mechanisms.
As a result, any website the victim visits can craft requests that the browser will automatically send to OpenClaw with the victim's credentials, and OpenClaw will treat them as legitimate operator actions.
Potential impact
- Attackers could trigger unauthorized administrative or operational actions on HTTP operator endpoints using a victim's privileges.
- Critical configuration changes may be applied without the victim's knowledge.
- Operational workflows (e.g., starting, stopping, or reconfiguring jobs/services) could be manipulated, potentially disrupting service availability.
- Security-relevant settings or access controls could be weakened or misconfigured through forged requests.
- Logging or monitoring behaviors could be altered, reducing visibility into subsequent malicious activity.
General mitigation guidance
Effective mitigation generally involves adding robust CSRF protections and re-evaluating trust assumptions in proxy-based deployments:
- Enforce CSRF tokens: Require unguessable, per-session or per-request tokens for all state-changing HTTP operator endpoints accessed via a browser, validating them server-side.
- Validate origin for browser traffic: Check the
Originand/orRefererheaders on relevant endpoints and accept requests only from known, trusted origins associated with the legitimate OpenClaw UI. - Differentiate browser vs. non-browser clients: Prefer explicit API authentication (e.g., API keys, OAuth2 tokens) from automation components and avoid ambient browser credentials for high-risk operator functions.
- Apply least privilege to operator actions: Ensure operator endpoints enforce strict authorization checks and minimize the scope of what each authenticated principal can do.
- Separate administrative surfaces: Where feasible, isolate operator endpoints on dedicated hostnames or interfaces not directly accessed by end-user browsers, reducing exposure to CSRF.
- Harden trusted-proxy assumptions: Treat proxy-based trust as an additional layer, not a substitute for application-level request validation and CSRF defenses.
How teams detect issues like this
Organizations can detect and monitor for this class of issue using several approaches:
- Static analysis and linting:
- Flag state-changing HTTP handlers that:
- Are reachable from browser contexts, and
- Do not enforce CSRF tokens, origin checks, or explicit non-browser authentication.
- Code review checklists:
- Require reviewers to verify that:
- Operator or administrative endpoints include CSRF protections when they are browser-accessible.
- Trusted-proxy code paths do not bypass standard web security controls (CSRF, authz checks).
- Configuration and policy enforcement:
- Implement security policies that mandate CSRF mechanisms for all non-idempotent endpoints exposed to browsers (e.g., POST/PUT/PATCH/DELETE).
- Use security gateways or WAF rules that can verify
Originheaders or block suspicious cross-site request patterns where appropriate. - Runtime monitoring:
- Monitor logs for anomalous operator actions, especially those coming from unusual Referer or Origin values, or from unexpected client IP ranges behind the trusted proxy.
- Alert on bursts of operator actions that deviate from normal usage patterns for a given user or service identity.

