OpenClaw hook transform path containment missed symlink-resolved escapes

Description

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.

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-03-03 23:00:53 UTC
Updated
2026-03-03 23:00:53 UTC
GitHub reviewed
2026-03-03 23:00:53 UTC

CVSS Scores

Base score Version Severity Vector
7.3 4.0
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Click to expand
Attack vector (AV:L)
Attacker needs local access on the target system.
Attack complexity (AC:H)
Exploitation depends on constrained or hard-to-reproduce conditions.
Attack requirements (AT:P)
Additional preconditions must be present for exploitation.
Privileges required (PR:L)
Low privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:H)
High confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:H)
High integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:H)
High availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.

Identifiers

Type Value
GHSA GHSA-659f-22xc-98f2 ↗

CWEs

CWE id Name
CWE-94 Improper Control of Generation of Code ('Code Injection')

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
npm openclaw <= 2026.2.21-2 2026.2.22

References

cvelogic Threat Intelligence