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

GHSA-659f-22xc-98f2: OpenClaw hook transform path containment missed symlink-resolved escapes

highCVSS 4.0 7.3

OpenClaw 2026.2.21-2 and earlier checked webhook transform module paths only lexically. A symlink inside the transforms directory could point outside it, and the gateway would import and run that JavaScript with its own privileges. Upgrade to openclaw 2026.2.22.

Published Mar 3, 2026 · Analysis Oct 31, 2026

What an attacker can do

Hook transforms are JavaScript modules the gateway imports dynamically. They are loaded from hooks.transformsDir or from hooks.mappings[].transform.module. The containment check compared path strings only, so a symlink such as linked.mjs inside the transforms root that points to a file elsewhere passed the check. The gateway then imported the target and ran it as code in the gateway process.

The attacker needs a foothold. The advisory lists three preconditions: hook transforms are enabled and reachable, the attacker can influence transform path resolution (for example through privileged config access or a writable location in the transform tree), and a symlink escape leads to attacker-controlled code. The CVSS 4.0 vector is local with low privileges and high attack complexity.

The result is code execution as the gateway user, with access to its tokens, channel credentials and files. It matters most where the transforms directory is writable by less-trusted users, a shared volume, or an automated process.

Who is affected

openclaw (npm) versions up to and including 2026.2.21-2, on deployments that enable hook transforms through hooks.transformsDir or hooks.mappings[].transform.module.

npm ls openclaw
find <your-transforms-dir> -type l -ls

Replace the directory with your configured hooks.transformsDir. The find command lists symlinks in the tree, which should normally be empty or point inside it.

openclaw

Ecosystem
npm
Affected
<= 2026.2.21-2
Fixed in
2026.2.22
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.2.22:

npm install [email protected]

The fix adds a realpath-aware check in resolveContainedPath in src/gateway/hooks-mapping.ts. It resolves the nearest existing ancestor of the path and rejects it if its real location is outside the real transforms root. The lexical checks for .. and absolute paths stay. Symlinks that stay inside the root still work. The sources list no other workaround; keep the transforms directory writable only by trusted users.

How to tell if you were hit

List symlinks under your hooks transforms directory and check where each resolves. Any link pointing outside the directory is suspect. After upgrading, a symlink escape makes startup fail with a "must be within" error, or an error naming Hook transformsDir. Review gateway process children and network calls for activity that started when a hook fired. Beam records agent shell commands, which helps if the injected code runs commands.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Vulnerability

Webhook transform modules were validated with lexical path checks only. A symlink under the allowed hooks transform tree could resolve outside the intended directory and be dynamically imported.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Affected versions: <= 2026.2.21-2
  • Patched version (planned next release): 2026.2.22

Impact

When an attacker can cause a transform module path to reference a symlinked entry that resolves outside the trusted transform directory, the gateway may import and execute unintended JavaScript with gateway-process privileges.

Attack Preconditions

  • Hook transforms are enabled and reachable.
  • Attacker can influence transform path resolution (for example via privileged config access and/or writable filesystem path in the transform tree).
  • A symlink escape exists to attacker-controlled code.

Remediation

  • Enforce realpath-aware containment for existing path ancestors before dynamic import.
  • Keep lexical containment checks for traversal and absolute-path escapes.
  • Add regression coverage for:
  • transform module symlink escape rejection,
  • hooks.transformsDir symlink escape rejection,
  • in-root symlink allow-case.

Fix Commit(s)

  • f4dd0577b055f77af783105bd65eae32f3d5e6a1

OpenClaw thanks @aether-ai-agent for reporting.

Questions

Is a symlink inside the transforms directory still allowed?

Yes, if it points to a file that is still inside the transforms root. The fix rejects only links whose real location escapes it.

What access does an attacker need?

Ability to influence the transform path, for example through privileged config access or a writable path in the transform tree, plus a symlink leading to code they control.

Which version fixes it?

openclaw 2026.2.22. Versions up to 2026.2.21-2 are affected. The advisory has no CVE id in the 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