/

CVE-2026-22172

Severity:

CRITICAL RISK

(9.9)

Authorization Bypass in OpenClaw WebSocket Scope Handling

CVE-2026-22172

Analyzed

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-862

Impact:

Privilege Escalation to Administrative Operations

Severity:

CRITICAL RISK

(9.9)

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 versions prior to 2026.3.12 contain an authorization bypass in the WebSocket connection flow that allows clients to self-declare elevated scopes without proper server-side verification.

An attacker using a shared token or password-authenticated session can claim privileged scopes such as operator.admin and perform administrative gateway operations that should be restricted to authorized operators.

Affected context

This vulnerability arises in OpenClaw deployments that expose the WebSocket gateway for authenticated clients using shared tokens or password-based login.

The issue occurs when the WebSocket connect path honors client-declared scopes without binding them to the authenticated principal or enforcing server-side authorization checks.

Environments where WebSocket connections are used for control, management, or operator actions are particularly affected, especially if tokens are long-lived or widely shared within teams or systems.

Exploit preconditions

  • Attack surface: Network-exposed OpenClaw WebSocket gateway.
  • Required access: Ability to authenticate with a shared token or valid user credentials (no need for prior admin rights).
  • Trigger point: Establishing a WebSocket connection and declaring or negotiating scopes during the connect or handshake phase.
  • Why exploitation is possible: The server accepts client-supplied scopes without binding them to the authenticated identity's authorized roles, resulting in missing authorization checks for sensitive scopes (e.g., operator.admin).

Why this happens

The root cause is a missing authorization control on the mapping between authenticated identities and requested scopes in the WebSocket connection logic.

Instead of deriving permissible scopes solely from server-side policy and token claims, the implementation trusts scope declarations passed by the client during connection setup.

This pattern aligns with CWE-862: Missing Authorization, where the system fails to verify that the authenticated user is permitted to perform the requested privileged operations or to hold specific high-privilege scopes.

Potential impact

  • Attackers may acquire operator.admin or other privileged scopes without proper authorization.
  • Unauthorized modification of gateway configuration, routing rules, or operational settings.
  • Execution of admin-only operations such as restarting services, draining nodes, or toggling security-sensitive flags.
  • Potential disruption of service availability or integrity through misconfiguration or abusive administrative actions.
  • Escalation from standard user or shared-token access to full control over the OpenClaw gateway environment.

General mitigation guidance

Effective mitigation focuses on enforcing strict server-side authorization for scopes and administrative actions:

  • Derive effective scopes exclusively from server-side token claims, role mappings, or access control lists, ignoring any client-supplied overrides.
  • Bind scopes tightly to the authenticated principal and validate them against a centralized authorization policy before establishing the WebSocket session.
  • Apply fine-grained authorization checks on each admin-only operation, not just at connection time, to guard against scope confusion.
  • Minimize or eliminate the use of broadly shared tokens; favor individually scoped credentials with least-privilege permissions.
  • Log and review administrative operations to detect anomalous use of privileged scopes and support incident response.

How teams detect issues like this

Detection generally relies on examining code paths and runtime behavior for missing or ineffective authorization checks:

  • Use static analysis or code review to identify WebSocket handlers and connection setup logic that accept client-declared scopes or roles without validating them against server-side policy.
  • Check that all admin-only operations are protected by explicit authorization gates, not just authentication checks.
  • Implement security tests that attempt to request privileged scopes from non-admin accounts and verify that such requests are rejected.
  • Monitor logs for patterns such as non-admin accounts suddenly using operator.admin or equivalent scopes, or abnormal volumes of administrative operations.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-rqpp-rjj8-7wv8
vulncheck.comvulncheck.com/advisories/openclaw-scope-elevation-in-websocket-shared-auth-connections

Frequently asked

questions

Yes. Any attacker who can reach the exposed OpenClaw WebSocket gateway and authenticate with a valid shared token or credentials may be able to claim elevated scopes.

No. The flaw allows non-admin authenticated users, including those using shared tokens, to self-declare privileged scopes that are not legitimately assigned to them.

Enforce strict server-side control of scopes: ignore client-supplied scope claims, derive effective permissions from trusted token claims or role mappings, and ensure all administrative operations are guarded by explicit authorization checks.

Adopt a consistent authorization model where permissions and scopes are computed solely on the server, implement centralized access control checks for all sensitive operations, and include targeted security tests and code review checklists for authentication and authorization paths, particularly around WebSocket and other real-time channels.

Find out what's already
exploitable in your codebase.