AgentbeamBeta
AI agent vulnerability · OpenClaw

CVE-2026-42421: OpenClaw: Existing WS sessions survive shared gateway token rotation

mediumCVSS 4.0 5.9GHSA-5h3f-885m-v22w

OpenClaw, the open-source AI assistant, did not disconnect existing WebSocket sessions when you rotated the shared gateway token. A client that authenticated with the old token stayed connected after the rotation. The openclaw npm package up to 2026.4.1 is affected. Upgrade to 2026.4.8.

Published Apr 9, 2026 · Updated Apr 28, 2026 · Analysis Nov 6, 2026

What an attacker can do

The gateway authenticates WebSocket clients with a shared token. Rotating that token is the normal response to a leak or a departed user. In affected versions the rotation changed the accepted token for new connections but left sessions already authenticated with the old token open. The weakness is CWE-613, insufficient session expiration.

So a party who held the old token and had a live session keeps their access after you believe you revoked it. They can keep sending whatever the gateway accepts from an authenticated client until the process restarts or the connection drops. The advisory does not say what those messages can do, and it names no exploit. The CVSS 4.0 vector rates integrity impact high, with local access and passive user involvement.

The advisory scopes this to OpenClaw as a user-controlled local assistant, not a multi-tenant service. The practical risk sits with shared gateways where more than one person or device holds the token, and with teams that rotate the token after a suspected compromise.

Who is affected

The openclaw npm package at 2026.4.1 and below. The package data lists everything below 2026.4.8 as vulnerable. Only deployments that authenticate with the shared gateway token are relevant. Check:

npm ls openclaw

openclaw

Ecosystem
npm
Affected
< 2026.4.8
Fixed in
2026.4.8
Check
npm ls openclaw

How to fix it

Upgrade openclaw to 2026.4.8 or later.

npm install [email protected]

The fix is commit d7c3210cd6f5 on main, checked with regression tests according to the advisory. No workaround is given. Until you upgrade, restart the gateway after rotating the shared token so that old sessions are dropped; that is our suggestion, not the advisory.

How to tell if you were hit

After a token rotation, list the gateway live WebSocket connections and confirm that none were opened before the rotation time. Review gateway logs for activity from a client that kept sending messages after the rotation. The advisory gives no log line.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

Existing WS sessions survive shared gateway token rotation.

Rotating the shared gateway token did not disconnect existing shared-token WebSocket sessions.

OpenClaw is a user-controlled local assistant. This advisory is scoped to the OpenClaw trust model and does not assume a multi-tenant service boundary.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Affected versions: <= 2026.4.1
  • Patched versions: 2026.4.8

Fix

The issue was fixed on main and is available in the patched npm version listed above. The verified fixed tree is commit d7c3210cd6f5fdfdc1beff4c9541673e814354d5.

Verification

The fix was re-checked against main before publication, including targeted regression tests for the affected security boundary.

Credits

Thanks @kexinoh of Tencent zhuque Lab (https://github.com/Tencent/AI-Infra-Guard) for reporting.

Credited to kexinoh.

Questions

What goes wrong when I rotate the token?

New connections need the new token, but WebSocket sessions already authenticated with the old shared token were not disconnected.

Which version fixes it?

openclaw 2026.4.8. Versions 2026.4.1 and earlier are affected.

Is there a CVE?

No. The advisory shows none. It is tracked as GHSA-5h3f-885m-v22w and rated moderate.

How do I clear old sessions before upgrading?

Restart the gateway after rotating the token. The advisory does not give this step; it follows from how the sessions persist.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More OpenClaw vulnerabilities

All OpenClaw entries