/

CVE-2026-42422

Severity:

HIGH RISK

(8.8)

Authorization Bypass / Improper Authorization

CVE-2026-42422

Analyzed

Vulnerability type

Category:

Authorization Bypass / Improper Authorization

CWE:

CWE-863

Impact:

Privilege Escalation and Unauthorized Access via Token Minting

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 versions prior to 2026.4.8 contain an authorization logic bypass in the device.token.rotate function that allows minting access tokens with unapproved roles and scopes.

By bypassing the intended device role-upgrade pairing and approval process, an attacker can preserve or create elevated roles without proper authorization, leading to potentially broad access escalation.

Affected context

This vulnerability affects environments where OpenClaw issues tokens for devices and relies on device.token.rotate to refresh or rotate those tokens.

It is most relevant when:

  • Device roles and scopes are expected to change only after an explicit approval or pairing flow
  • Authorization decisions are enforced primarily via roles/scopes embedded in tokens
  • Downstream services trust these tokens as authoritative without re-checking the original approval state

In such setups, a logic flaw in token rotation can allow a device or attacker to retain or acquire roles that were never properly approved.

Exploit preconditions

  • Attack surface: The device.token.rotate function or API endpoint that handles device token rotation.
  • Required access: Ability to invoke token rotation for a device (e.g., via a valid but potentially low-privileged or partially-approved device identity or session).
  • Trigger point: Calling device.token.rotate under conditions where the system should downgrade, update, or re-approve device roles/scopes.
  • Why exploitation is possible: The authorization logic does not correctly enforce role-upgrade pairing and approval checks during rotation, allowing the preservation or minting of roles/scopes that have not undergone the intended approval workflow.

Why this happens

The issue stems from improper authorization logic in the token rotation workflow.

Instead of strictly deriving roles and scopes from the authoritative approval state (e.g., stored device records, pairing status, or admin approvals), device.token.rotate allows clients to end up with tokens that include roles not validated against that state.

This maps to CWE-863: Incorrect Authorization, where an operation that changes or re-issues security credentials (tokens) fails to re-validate the caller's permissions and the allowed role set.

Conceptually, the token rotation path becomes a secondary authority for roles/scopes, diverging from the primary approval system and creating a path to mint or retain elevated privileges.

Potential impact

  • Device tokens may include roles that were never explicitly approved.
  • Attackers could preserve elevated roles that should have been downgraded or revoked during rotation.
  • Unauthorized access to APIs or data protected by higher-privilege roles and scopes.
  • Lateral movement within the system by leveraging unapproved roles for broader access.
  • Violation of least-privilege assumptions and potential regulatory or compliance impact if access boundaries are bypassed.

General mitigation guidance

Effective mitigation focuses on centralizing and re-validating authorization during token lifecycle operations:

  • Ensure that device.token.rotate derives roles and scopes exclusively from an authoritative server-side source of truth (e.g., device records, pairing state, admin approval records), not from client input or existing tokens.
  • Enforce that any role change, upgrade, or expansion of scopes must go through an explicit approval workflow separate from token rotation.
  • Make token rotation a purely mechanical operation: renew token lifetimes, but never implicitly grant or preserve roles beyond what the current approval state allows.
  • Apply defense-in-depth by having downstream services validate that sensitive roles/scopes are allowed for the current device/account state, rather than trusting token contents alone.
  • Design role and scope models with clear downgrade and revocation paths so that revoked or unapproved privileges cannot be carried forward during token refresh.

How teams detect issues like this

Organizations can detect and monitor for this class of issue through a combination of design review and runtime checks:

  • Static analysis / code review: Look for paths where token issuance or rotation logic copies roles/scopes from existing tokens or client-controlled fields instead of re-fetching from a centralized authorization store.
  • Authorization-focused tests: Include tests that simulate role downgrade or unapproved role requests, then verify that rotated tokens reflect the correctly restricted roles and scopes.
  • Audit logging: Log token rotation events with before/after role and scope sets; alert on cases where tokens gain roles without a corresponding approved change in device or account state.
  • Policy enforcement: Use access control policies or gateways that validate roles against a central directory or authorization service, making it harder for mis-issued tokens to be accepted unnoticed.
  • Automated security review tools can assist by flagging token-management functions that bypass established authorization services or perform role logic locally.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/d7c3210cd6f5fdfdc1beff4c9541673e814354d5
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-whf9-3hcx-gq54
vulncheck.comvulncheck.com/advisories/openclaw-role-bypass-in-device-token-rotate-function

Frequently asked

questions

Exploitability depends on how easily an attacker can trigger device.token.rotate. If device token rotation is accessible to any authenticated device or user without additional checks, a large portion of the deployed fleet may be at risk of unauthorized role minting or preservation.

Not necessarily. Often, the attacker only needs the ability to act as a device or account that can initiate token rotation. From there, the flawed authorization logic can allow them to retain or obtain roles beyond those legitimately approved.

The most robust fix is to centralize role and scope decisions in an authoritative backend and ensure device.token.rotate always recomputes the allowed privilege set from that backend. Rotation should never increase privileges, and it should always reflect current approvals and revocations.

Treat token-issuing and rotation functions as high-risk authorization points. Use a single source of truth for roles and scopes, enforce clear workflows for privilege changes, add tests around downgrade and revocation scenarios, and incorporate security review of authorization logic into your standard development and CI processes.

Find out what's already
exploitable in your codebase.