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

CVE-2026-27001: OpenClaw: Unsanitized CWD path injection into LLM prompts

highCVSS 4.0 8.6GHSA-2qj5-gwg2-xwc4

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 --version

Any 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 entries