GHSA-5h3g-6xhh-rg6p: openclaw: TOCTOU race allows out-of-sandbox file read
GHSA-5h3g-6xhh-rg6p MEDIUMOpenClaw's filesystem bridge contains a time-of-check/time-of-use race condition that lets an attacker swap a symlink between path validation and the actual byte read, causing the agent's sandbox to read files outside its intended mount root — including host credentials, LLM API keys, and configuration files. For teams running AI agent workflows with OpenClaw, this is not an isolated finding: the package carries 135 historical CVEs and AIID incident #1368 documents malicious OpenClaw skills actively distributing the AMOS Stealer for credential exfiltration, confirming real-world exploitation of this ecosystem. No EPSS data or public exploit exists yet, but the combination of low-barrier tooling (skills ecosystem), documented ecosystem abuse, and sensitive data access within typical agent deployments elevates practical risk above the nominal CVSS score. Upgrade to openclaw@2026.4.22 immediately — no viable workaround exists short of OS-level filesystem isolation.
What is the risk?
Medium severity in isolation, elevated in AI agent deployments where OpenClaw processes untrusted inputs or third-party skills with filesystem access. The TOCTOU race requires timing precision that prevents trivial exploitation, but an adversary controlling agent inputs or distributing a malicious skill (as documented in AIID #1368) can reliably trigger it with repeated attempts. The package's 135-CVE history signals systemic security debt, and the skills ecosystem abuse documented in the incident database means the attack surface is broader than the npm download count alone suggests.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| OpenClaw | npm | <= 2026.4.21 | 2026.4.22 |
Do you use OpenClaw? You're affected.
How severe is it?
What should I do?
5 steps-
Upgrade openclaw to >= 2026.4.22 immediately — the fix introduces O_NOFOLLOW semantics, file descriptor pinning validated against canonical mount root, and rejection of hardlink and symlink bypass attempts.
-
If upgrade is blocked, confine the OpenClaw process to a dedicated low-privilege user and apply OS-level filesystem restrictions (AppArmor profile or seccomp filter) limiting accessible directory trees to only what the agent legitimately needs.
-
Audit installed OpenClaw skills and third-party plugins for provenance, given the documented skills-ecosystem abuse in AIID #1368.
-
Rotate any credentials or API keys accessible from the OpenClaw process's working directories on affected versions.
-
Review filesystem access logs for anomalous reads outside expected agent working directories as an indicator of prior exploitation.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is GHSA-5h3g-6xhh-rg6p?
OpenClaw's filesystem bridge contains a time-of-check/time-of-use race condition that lets an attacker swap a symlink between path validation and the actual byte read, causing the agent's sandbox to read files outside its intended mount root — including host credentials, LLM API keys, and configuration files. For teams running AI agent workflows with OpenClaw, this is not an isolated finding: the package carries 135 historical CVEs and AIID incident #1368 documents malicious OpenClaw skills actively distributing the AMOS Stealer for credential exfiltration, confirming real-world exploitation of this ecosystem. No EPSS data or public exploit exists yet, but the combination of low-barrier tooling (skills ecosystem), documented ecosystem abuse, and sensitive data access within typical agent deployments elevates practical risk above the nominal CVSS score. Upgrade to openclaw@2026.4.22 immediately — no viable workaround exists short of OS-level filesystem isolation.
Is GHSA-5h3g-6xhh-rg6p actively exploited?
No confirmed active exploitation of GHSA-5h3g-6xhh-rg6p has been reported, but organizations should still patch proactively.
How to fix GHSA-5h3g-6xhh-rg6p?
1. Upgrade openclaw to >= 2026.4.22 immediately — the fix introduces O_NOFOLLOW semantics, file descriptor pinning validated against canonical mount root, and rejection of hardlink and symlink bypass attempts. 2. If upgrade is blocked, confine the OpenClaw process to a dedicated low-privilege user and apply OS-level filesystem restrictions (AppArmor profile or seccomp filter) limiting accessible directory trees to only what the agent legitimately needs. 3. Audit installed OpenClaw skills and third-party plugins for provenance, given the documented skills-ecosystem abuse in AIID #1368. 4. Rotate any credentials or API keys accessible from the OpenClaw process's working directories on affected versions. 5. Review filesystem access logs for anomalous reads outside expected agent working directories as an indicator of prior exploitation.
What systems are affected by GHSA-5h3g-6xhh-rg6p?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, AI agent sandboxes, local AI agent deployments, AI tool orchestration platforms.
What is the CVSS score for GHSA-5h3g-6xhh-rg6p?
No CVSS score has been assigned yet.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.005 AI Agent Tool AML.T0037 Data from Local System AML.T0053 AI Agent Tool Invocation AML.T0105 Escape to Host Compliance Controls Affected
What are the technical details?
Original Advisory
## Summary OpenShell FS bridge reads pin and verify the opened file before returning bytes ## Affected Packages / Versions - Package: openclaw (npm) - Affected versions: <= 2026.4.21 - Fixed version: 2026.4.22 ## Impact A time-of-check/time-of-use race around OpenShell sandbox filesystem reads could let a symlink swap cause bytes outside the intended mount root to be read. ## Fix OpenShell reads now open the file with no-follow semantics where available, validate the pinned file descriptor against the canonical mount root, reject unsafe hardlink/symlink cases, and use a strict fallback ancestor walk on platforms without fd-path readback. ## Fix Commit(s) - 95119017c847c737bd113f0bff728c4666d79c45 ## Verification - The fix commit is contained in the public v2026.4.22 tag. - openclaw@2026.4.22 is published on npm and the compiled package contains the fix. - Focused regression coverage for this path passed before publication. OpenClaw thanks @VladimirEliTokarev for reporting.
Exploitation Scenario
An adversary publishes or compromises a malicious OpenClaw skill (consistent with the AIID #1368 attack pattern documented in February 2026). The skill invokes the OpenShell FS bridge to read a legitimate file within the allowed mount root, while concurrently racing a symlink replacement — swapping the target path to point to /root/.aws/credentials, the agent's LLM API key file, or another high-value target. Between OpenShell's validation check and the actual file descriptor read, the symlink resolves to the sensitive target outside the mount root. The skill receives the file contents as if they were the originally requested file and exfiltrates them to an attacker-controlled endpoint. In containerized deployments lacking additional OS-level controls, repeated race attempts achieve reliable success within seconds.
Weaknesses (CWE)
CWE-367 — Time-of-check Time-of-use (TOCTOU) Race Condition: The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
- [Implementation] The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.
- [Implementation] When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.
Source: MITRE CWE corpus.
References
Timeline
Related Vulnerabilities
CVE-2026-33579 9.9 OpenClaw: scope bypass escalates low-priv to admin
Same package: openclaw CVE-2026-32922 9.9 OpenClaw: privilege escalation to RCE via token scope bypass
Same package: openclaw CVE-2026-30741 9.8 OpenClaw: RCE via request-side prompt injection
Same package: openclaw CVE-2026-32038 9.8 Analysis pending
Same package: openclaw CVE-2026-53838 9.8 OpenClaw: approval scope bypass via reconnection state
Same package: openclaw