/

CVE-2026-41404

Severity:

HIGH RISK

(8.8)

Improper Authorization in OpenClaw Trusted-Proxy Mode

CVE-2026-41404

Analyzed

Vulnerability type

Category:

Improper Authorization

CWE:

CWE-863

Impact:

Privilege Escalation to Operator/Admin

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenClaw before 2026.3.31 contains an authorization flaw where operator scopes are not fully cleared in trusted-proxy authentication mode. Under specific identity-bearing request flows, self-declared scopes from non-Control-UI clients can persist and be treated as trusted.

This can allow an attacker to escalate to operator.admin privileges when they can influence scope declarations on requests passing through the trusted proxy.

Affected context

The vulnerability appears in OpenClaw deployments configured to use a trusted-proxy authentication mode, where upstream proxies forward identity and scope information to OpenClaw.

It mainly affects flows where:

  • Non-Control-UI clients can send or influence scope declarations,
  • The proxy or gateway forwards those scopes as part of the authenticated context, and
  • The application relies on scope-clearing or re-mapping logic before assigning final privileges.

When scope-clearing is incomplete on these paths, self-declared scopes can be misinterpreted as trusted operator scopes.

Exploit preconditions

  • Attack surface: HTTP or API endpoints behind the trusted proxy that accept or propagate identity and scope information.
  • Required access: Ability to send requests through the trusted proxy as, or on behalf of, an authenticated client (e.g., possessing a valid session, token, or network position to reach the proxy).
  • Trigger point: Declaring or manipulating operator-like scopes on non-Control-UI client requests and causing those requests to reach an identity-bearing authentication path.
  • Why exploitation is possible: The authorization layer does not fully clear or re-evaluate self-declared scopes when transitioning from untrusted to trusted context, allowing attacker-controlled scope values to be treated as authoritative and granting operator.admin privileges.

Why this happens

This issue stems from incomplete authorization scoping and sanitization in the trusted-proxy mode.

The system treats scopes coming from certain client contexts as if they were fully validated, but fails to reliably clear or overwrite scopes that originated from non-privileged, self-declared sources.

This aligns with CWE-863: Improper Authorization, where enforcement decisions are based on incomplete or improperly sanitized context, enabling users to gain access to resources or operations beyond their intended privileges.

Conceptually, the authorization logic couples trust in the proxy with trust in all scope attributes forwarded by it, instead of enforcing a strict boundary between user-controlled scope declarations and server-assigned privileges.

Potential impact

  • Escalation of a regular user or operator to operator.admin privileges.
  • Unauthorized access to administrative or operator-only functions.
  • Modification of critical configuration, policies, or operational workflows.
  • Potential disruption of service operation through misuse of elevated capabilities.
  • Increased blast radius for any compromised user account or API token.

General mitigation guidance

Mitigation typically focuses on tightening the authorization model around scopes and trusted headers in proxy-based authentication setups.

Useful defensive patterns include:

  • Treating all client-declared scopes and roles as untrusted inputs, independent of transport path, and re-deriving effective scopes on the server side.
  • Explicitly clearing or overwriting any incoming scope/role attributes when transitioning into an authenticated identity context, then rebuilding the allowed scopes from authoritative sources (e.g., identity provider claims, server-side role mappings).
  • Restricting which headers or parameters the trusted proxy is allowed to set, and whitelisting only those that are strictly necessary.
  • Adding defense-in-depth checks in authorization middleware so only server-assigned scopes can unlock operator or admin actions.
  • Applying least-privilege defaults, ensuring that if scope processing fails or is ambiguous, the user receives the lowest practical level of access.

How teams detect issues like this

Detection can focus on both code-level signals and runtime behavior:

  • Static analysis / code review:
  • Identify code paths where scopes or roles are derived from request headers, query parameters, or client-controlled data in trusted-proxy mode.
  • Flag any authorization decision that depends on unvalidated or partially cleared scope information.
  • Look for conditional logic where some paths clear scopes and others do not, especially across UI vs non-UI flows.
  • Configuration and policy review:
  • Inspect reverse proxy or gateway configs to see which identity and scope headers are trusted and how they are mapped.
  • Ensure that only the proxy can inject identity headers, and that their usage is documented and constrained.
  • Runtime monitoring:
  • Log scope values and decision points for privileged actions, and alert on unusual patterns, such as non-Control-UI clients invoking operator or admin operations.
  • Automated tooling:
  • Use automated security testing tools or custom scripts to send crafted requests with elevated scopes and observe whether unauthorized access is granted.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/8b88b927cb0747ad24d95b07d35682bf85dc5b0e
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-g374-mggx-p6xc
vulncheck.comvulncheck.com/advisories/openclaw-operator-admin-privilege-escalation-via-trusted-proxy-authentication

Frequently asked

questions

Exploitability depends on how the trusted proxy and clients are configured.

In environments where non-Control-UI clients can influence scope declarations that the proxy forwards, and where those scopes are not fully cleared before authorization, the issue can be exploited to gain elevated privileges.

In tightly controlled setups where scope values cannot be manipulated by end users, practical exploitation is more limited.

Typically yes, the attacker needs the ability to send requests through the trusted proxy to the OpenClaw instance.

This usually implies some form of authenticated or internal network access, such as a compromised user account, API token, or position on an internal network segment that can reach the proxy.

The safest pattern is to ensure that scopes and roles are never trusted directly from client-controllable fields.

Clear all incoming scope data at authentication boundaries and reconstruct effective scopes solely from authoritative identity sources and server-side policy.

Additionally, explicitly gate operator.admin actions behind strictly server-assigned attributes.

Prevention relies on designing authorization around clear trust boundaries:

  • Separate identity transport (e.g., headers from a trusted proxy) from the derivation of privileges.
  • Establish coding guidelines that prohibit trusting user-influenced scopes or roles for privilege decisions.
  • Introduce centralized authorization middleware that enforces uniform scope-clearing and reconstruction.
  • Incorporate security-focused code review and automated checks for improper use of proxy headers or client-supplied scope information.
Find out what's already
exploitable in your codebase.