AgentbeamBeta
AI agent vulnerability · OpenClaw

GHSA-hv93-r4j3-q65f: OpenClaw Hook Session Key Override Enables Targeted Cross-Session Routing

highCVSS 3.1 7.1

OpenClaw from 2.0.0-beta3 up to but not including 2026.2.12 let a holder of a hook token pick the session a message lands in. POST /hooks/agent accepted a sessionKey in the payload and used it directly, so an attacker could inject prompts into chosen sessions. Upgrade openclaw to 2026.2.12 and keep hooks.allowRequestSessionKey off.

Published Feb 17, 2026 · Analysis Nov 24, 2026

What an attacker can do

OpenClaw's hook ingress takes messages over HTTP and hands them to an agent session. Before the fix, POST /hooks/agent read a sessionKey from the request body and routed the message to that session. Session keys often follow a guessable shape, such as agent:main:dm followed by a peer id, and the peer id is often known from public metadata. That makes targeting practical (CWE-639, with CWE-330 for the predictable keys).

The attacker needs three things: a valid hook token, an ingress that allows request-selected session keys, and a key they can derive or guess. Without all three, predictable key formats alone give no access, as the advisory states.

The main impact is integrity. The attacker inserts a message or prompt into another user's agent session, so the agent treats it as part of that conversation. If the same session key is reused, the injected context persists and shapes later turns. The advisory rates confidentiality impact as secondary and dependent on other weaknesses. Teams that give hook tokens to external services, or run one gateway for several people, carry the most risk.

Who is affected

Affected: the npm package openclaw, from 2.0.0-beta3 up to but not including 2026.2.12. Version 2026.2.12 is patched. You are exposed if hooks are enabled, you share the hook token with others, and your config allows request-level session keys.

Check your version and hook config:

npm ls -g openclaw
openclaw --version

Then look in your config for the hooks block and the value of allowRequestSessionKey.

openclaw

Ecosystem
npm
Affected
>= 2.0.0-beta3, < 2026.2.12
Fixed in
2026.2.12
Check
npm ls openclaw

How to fix it

Upgrade openclaw to 2026.2.12 or later:

npm install -g openclaw@latest

The fix is secure by default. POST /hooks/agent now rejects a payload sessionKey unless hooks.allowRequestSessionKey is true. New settings are hooks.defaultSessionKey for a fixed ingress session and hooks.allowedSessionKeyPrefixes to restrict explicit keys. The security audit now warns about unsafe hook session routing. The advisory recommends this config:

{
  "hooks": {
    "enabled": true,
    "token": "${OPENCLAW_HOOKS_TOKEN}",
    "defaultSessionKey": "hook:ingress",
    "allowRequestSessionKey": false,
    "allowedSessionKeyPrefixes": ["hook:"]
  }
}

How to tell if you were hit

Check the gateway's access logs for POST requests to /hooks/agent whose body carries a sessionKey that does not start with your hook prefix, and for messages appearing in sessions that no real user wrote. Review session transcripts for instructions that look injected. Run the OpenClaw security audit, which now flags unsafe hook session-routing settings.

Rotate the hook token if you find a mismatch, and clear poisoned sessions.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The issue is not deterministic session keys by itself. The exploitable path was accepting externally supplied sessionKey values on authenticated hook ingress, allowing a hook token holder to route messages into chosen sessions.

Affected Behavior

  • POST /hooks/agent accepted payload sessionKey and used it directly for session routing.
  • Common session-key shapes (for example agent:main:dm:<peerId>) were often derivable from known metadata, making targeted routing practical when request-level override was enabled.

Attack Preconditions

  • Attacker can call hook endpoints with a valid hook token.
  • Hook ingress allows request-selected sessionKey values.
  • Target session keys can be derived or guessed.

Without those preconditions, deterministic key formats alone do not provide access.

Impact

  • Integrity: targeted message/prompt injection into chosen sessions.
  • Persistence: poisoned context can affect subsequent turns when the same session key is reused.
  • Confidentiality impact is secondary and depends on additional weaknesses.

Affected Versions

  • openclaw >= 2.0.0-beta3 and < 2026.2.12

Patched Versions

  • openclaw >= 2026.2.12

Fix

OpenClaw now uses secure defaults for hook session routing:

  • POST /hooks/agent rejects payload sessionKey unless hooks.allowRequestSessionKey=true.
  • Added hooks.defaultSessionKey for fixed ingress routing.
  • Added hooks.allowedSessionKeyPrefixes to constrain explicit routing keys.
  • Security audit warns on unsafe hook session-routing settings.

Recommended Configuration

{
  "hooks": {
    "enabled": true,
    "token": "${OPENCLAW_HOOKS_TOKEN}",
    "defaultSessionKey": "hook:ingress",
    "allowRequestSessionKey": false,
    "allowedSessionKeyPrefixes": ["hook:"]
  }
}

Credit

Thanks @alpernae for responsible reporting.

Credited to alpernae.

Questions

Does GHSA-hv93-r4j3-q65f have a CVE?

No. The advisory shows no CVE id. It is tracked by its GitHub advisory id, and it rates the flaw high with a CVSS 3.1 score of 7.1.

Which OpenClaw version fixes it?

2026.2.12. Versions from 2.0.0-beta3 up to but not including 2026.2.12 are affected. The fix is commit 113ebfd.

Do deterministic session keys alone expose me?

No. The advisory says the flaw is accepting request-supplied session keys on hook ingress. Predictable key formats give no access without a valid hook token and an enabled override.

Is it exploited in the wild?

The sources do not say so. The advisory names no exploitation, and the entry has no CISA catalog data.

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