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

CVE-2026-41355: OpenClaw: OpenShell `mirror` mode can convert untrusted sandbox files into explicitly enabled workspace hooks and execute them on the host during gateway startup

mediumCVSS 4.0 5.4 · 3.1 7.3GHSA-42mx-vp8m-j7qh

OpenClaw 2026.3.24 and earlier, running OpenShell sandboxes in mirror mode, can copy a hooks/ directory from the sandbox into the host workspace. If workspace hooks are enabled and explicitly opted in, that code runs on the host at gateway startup. Upgrade to 2026.3.28.

Published Apr 7, 2026 · Updated May 6, 2026 · Analysis Oct 30, 2026

What an attacker can do

In mirror mode, OpenShell syncs the sandbox's files back into the host workspace. Before the fix, extensions/openshell/src/mirror.ts replaceDirectoryContents wiped every top-level entry in the workspace and copied everything from the sandbox. A hooks/ directory written by code inside the sandbox therefore landed where the host treats it as trusted hook code.

The maintainers call the issue narrow and rate it medium, not high. An exploit needs mirror mode, workspace hooks enabled, an explicit hook opt-in by the operator, and a gateway restart. The CVSS vector reflects this: local access, a privileged user, user interaction.

The case to worry about is an agent that works in a sandbox on untrusted content, such as a cloned repository or a web page. A prompt injection could make the agent write a hooks/ directory in the sandbox. After the next restart the gateway would run that code on the host with the gateway's rights, outside the sandbox. Teams that use mirror mode and workspace hooks together are exposed.

Who is affected

openclaw on npm, version 2026.3.24 and earlier, where the OpenShell extension uses mirror mode and workspace hooks are enabled. Check the version:

npm ls openclaw

Use npm ls -g openclaw for a global install. Setups without mirror mode, or without enabled hooks, do not meet the full chain.

openclaw

Ecosystem
npm
Affected
<= 2026.3.24
Fixed in
2026.3.28
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.3.28 or later, the first stable tag with the fix:

npm install [email protected]

Commit c02ee8a3a4cb390b23afdf21317aa8b2096854d1 makes replaceDirectoryContents accept an excludeDirs list, and the OpenShell backend passes hooks. The match is case-insensitive, so Hooks is excluded too. An existing host hooks/ directory is kept. The advisory lists no workaround besides upgrading. Disabling workspace hooks or mirror mode removes a link from the chain.

How to tell if you were hit

Check the workspace for a hooks/ directory (any letter case) that you did not create, and compare it with version control. Review file changes in the workspace after sandbox sessions, and any hook files that appeared before a gateway restart. Look at what the gateway process started right after restart. Beam records agent shell commands and file access, so it can show an agent creating hook files in the workspace.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

OpenShell mirror mode can convert untrusted sandbox files into explicitly enabled workspace hooks and execute them on the host during gateway startup

Current Maintainer Triage

  • Status: narrow
  • Normalized severity: medium
  • Assessment: Real on shipped <=2026.3.22 OpenShell mirror sync, but exploit needs mirror mode plus hooks enabled plus explicit hook opt-in plus restart, so high is overstated even though the direct fix shipped in v2026.3.28.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Latest published npm version: 2026.3.31
  • Vulnerable version range: <=2026.3.24
  • Patched versions: >= 2026.3.28
  • First stable tag containing the fix: v2026.3.28

Fix Commit(s)

  • c02ee8a3a4cb390b23afdf21317aa8b2096854d1 — 2026-03-25T19:59:07Z

Release Process Note

  • The fix is already present in released version 2026.3.28.
  • This draft looks ready for final maintainer disposition or publication, not additional code-fix work.

Thanks @tdjackey for reporting.

Credited to tdjackey.

Questions

Is every OpenShell user exposed to CVE-2026-41355?

No. The maintainers say the exploit needs mirror mode, hooks enabled, an explicit hook opt-in and a restart. Without all four, the path does not work.

Which version fixes it?

2026.3.28 is the first stable tag with the fix. The vulnerable range is 2026.3.24 and earlier.

Why only medium severity when it can run code on the host?

The chain needs several operator choices and a restart, so the maintainers call it narrow and say a high rating is overstated.

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