NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · OpenClaw

CVE-2026-45002: OpenClaw: Hook mapping templates could bypass hook session-key opt-in

mediumCVSS 4.0 6.9GHSA-2xcp-x87w-q377

OpenClaw before 2026.4.20 let a hook mapping with a templated sessionKey render an externally influenced session key even when hooks.allowRequestSessionKey was off. A webhook caller could choose which session their request routes to. Upgrade to openclaw 2026.4.20.

Published Apr 25, 2026 · Updated May 19, 2026 · Analysis Nov 5, 2026

What an attacker can do

Request-supplied session keys on hooks are gated by hooks.allowRequestSessionKey and by hooks.allowedSessionKeyPrefixes. A hook mapping whose sessionKey contained template placeholders, such as {{messages[0].id}}, skipped that gate. The template rendered values from the incoming webhook payload, so the caller controlled the resulting key even with the opt-in disabled.

The flaw affects webhook routing isolation. A caller with network access to the hook endpoint could steer a request into a session it should not reach, for example one that shares context with other work. The advisory is clear that it does not grant host execution by itself. The CVSS 4.0 vector needs no privileges or user interaction and shows low confidentiality and integrity impact.

The gateway now tags each mapping action's sessionKeySource as static or templated, and treats templated keys as externally supplied input.

Who is affected

The npm package openclaw before 2026.4.20. You are exposed if a hook mapping or preset, such as the Gmail preset key hook:gmail:{{messages[0].id}}, uses a templated sessionKey, and the hook endpoint is reachable by callers you do not trust.

npm ls openclaw

Check your hooks mappings for {{ }} placeholders inside sessionKey.

openclaw

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

How to fix it

Upgrade to openclaw 2026.4.20 or later:

npm install -g [email protected]

After the fix, a template-rendered session key requires hooks.allowRequestSessionKey=true plus the prefix checks in hooks.allowedSessionKeyPrefixes. The updated docs show prefixes such as hook: and hook:gmail:. A mapping with a static sessionKey needs no opt-in, so replacing the template with a fixed key avoids the requirement. Set the opt-in only if you need templated keys.

How to tell if you were hit

Review hooks configuration for mappings whose sessionKey contains {{ }}. In gateway logs, look for hook calls that landed in session keys you did not expect, or with identifiers taken from payload fields. Check session lists for keys created by unauthenticated hook callers.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Affected Packages / Versions

  • Package: openclaw (npm)
  • Affected versions: < 2026.4.20
  • Patched version: 2026.4.20

Impact

Templated hook mapping sessionKey values were treated differently from request-supplied session keys. A hook mapping could render an externally influenced session key even when hooks.allowRequestSessionKey was disabled, bypassing the intended routing opt-in for hook callers.

This affects webhook routing isolation. It does not grant host execution by itself. Severity is medium.

Fix

Template-rendered mapping session keys are now treated as externally supplied routing input and require hooks.allowRequestSessionKey=true plus the existing prefix policy checks.

Fix commit:

  • 5275d008ed33203dba3f98e969ad683a65c416c3

Release

Fixed in OpenClaw 2026.4.20.

Credited to zsxsoft, KeenSecurityLab, qclawer.

Questions

Does CVE-2026-45002 allow code execution?

Not by itself. The advisory says it affects webhook routing isolation and does not grant host execution.

Do static session keys need allowRequestSessionKey?

No. After the fix, only mappings with templated sessionKey values need hooks.allowRequestSessionKey=true and the prefix policy.

Will the fix break my Gmail preset?

It can. The Gmail preset key hook:gmail:{{messages[0].id}} is templated, so it now needs the opt-in and a matching prefix, or a static sessionKey override.

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