CVE-2026-27001: OpenClaw: Unsanitized CWD path injection into LLM prompts
OpenClaw put the current working directory into the agent system prompt without sanitizing it. A directory name containing newlines or Unicode bidi and zero-width characters could break the prompt structure and inject attacker instructions. Versions below 2026.2.15 are affected. Upgrade to 2026.2.15.
Published Feb 18, 2026 · Updated Feb 20, 2026 · Analysis Oct 31, 2026
What an attacker can do
buildAgentSystemPrompt() embedded the workspace path, plus sandbox strings such as the container workdir and noVNC URL, directly into the system prompt. A folder name is attacker-controlled text. If it holds a newline, a Unicode line or paragraph separator, or format characters like bidi overrides, it can end the line where the path sits and start a new instruction that the model reads as part of the prompt (CWE-77).
The attacker must get OpenClaw to run inside a directory with such a name. The usual way is a cloned or extracted repository, archive or shared folder whose name the attacker chose. No further interaction is needed once the agent starts there. The CVSS 4.0 vector is local, with high confidentiality, integrity and availability impact, because injected instructions drive the agent's tools.
The advisory says prompt injection may alter agent behavior and could lead to unintended tool use or disclosure of sensitive information. What an attacker gets depends on which tools the agent is allowed to use. With shell or file tools enabled, that can mean running commands and reading secrets.
Who is affected
The npm package openclaw at any version below 2026.2.15. The advisory names 2026.2.14 as the latest published vulnerable version at the time. Check your install:
npm ls -g openclaw
openclaw --versionAny agent run launched from a directory you did not name yourself is in scope.
openclaw
- Ecosystem
- npm
- Affected
- < 2026.2.15
- Fixed in
- 2026.2.15
- Check
npm ls openclaw
How to fix it
Upgrade to 2026.2.15, the patched version (fix commit 6254e96):
npm install -g [email protected]The new sanitizeForPromptLiteral() strips Unicode control characters, format characters and the line and paragraph separators from the workspace path before it enters any prompt. resolveRunWorkspaceDir() applies the same cleanup and logs a warning when characters are removed. The advisory lists no workaround. Until you upgrade, do not start the agent in directories with names you did not choose.
How to tell if you were hit
After upgrading, look in OpenClaw logs for the warning that workspace path characters were stripped. That marks a directory name that carried control or format characters. On older installs, list directory names with unusual characters, for example find . -name '*[[:cntrl:]]*', and check session transcripts for instructions that the user did not write. Beam's record of agent shell commands and tool calls can show actions that follow such an injected instruction.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Overview
OpenClaw embedded the current working directory (workspace path) into the agent system prompt without sanitization. If an attacker can cause OpenClaw to run inside a directory whose name contains control/format characters (for example newlines or Unicode bidi/zero-width markers), those characters could break the prompt structure and inject attacker-controlled instructions.
Impact
Prompt injection may alter agent behavior and could lead to unintended tool use or disclosure of sensitive information.
Affected Packages / Versions
- Package:
openclaw(npm) - Vulnerable versions:
< 2026.2.15(latest published vulnerable version as of 2026-02-16:2026.2.14) - Patched versions:
>= 2026.2.15
Fix
The workspace path is now sanitized before it is embedded into any LLM prompt output, stripping Unicode control/format characters and explicit line/paragraph separators. Workspace path resolution also applies the same sanitization as defense-in-depth.
Fix Commit(s)
6254e96acf16e70ceccc8f9b2abecee44d606f79
Thanks @aether-ai-agent for reporting.
Credited to aether-ai-agent.
Questions
- How does an attacker reach the prompt?
Through the directory name. The agent embeds the working directory path in its system prompt, so newlines or invisible characters in that name can add instructions.
- Which version fixes CVE-2026-27001?
2026.2.15. The workspace path is sanitized before it goes into any LLM prompt output.
- Does the fix change paths with normal Unicode?
Ordinary Unicode and spaces are kept. Only control characters, format characters and line or paragraph separators are removed, which is lossy by design.
- Is it exploited in the wild?
The sources do not report exploitation and it is not in CISA's KEV catalog.
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 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
