CVE-2026-45002: OpenClaw: Hook mapping templates could bypass hook session-key opt-in
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 openclawCheck 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
Read for this analysis:
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 entriesCVE-2026-62197
OpenClaw: Browser CDP discovery could accept blocked WebSocket URLs
medium8.5Oct 21, 2026CVE-2026-35630
OpenClaw: QQBot native approval buttons did not enforce configured approver identity
high8.0Jul 2, 2026CVE-2026-53806
OpenClaw: Combined POSIX shell options could confuse exec revalidation
high8.8Jul 2, 2026CVE-2026-53809
OpenClaw: Embedded runner policy could be confused by provider aliases
medium3.8Jul 2, 2026CVE-2026-53810
OpenClaw's marketplace runtime extension metadata could point at unscanned payloads
high8.8Jul 2, 2026CVE-2026-53811
OpenClaw: Matrix allowFrom could bind to mutable display names
high8.8Jul 2, 2026
