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

GHSA-9q2p-vc84-2rwm: OpenClaw: system.run allow-always persistence included shell-commented payload tails

mediumCVSS 3.1 5.0

In OpenClaw 2026.3.2 and earlier, system.run allowlist analysis ignored shell comments. After an allow-always approval, the commented-out tail of a command could be stored as a trusted command, even though the shell never ran it. Fixed in OpenClaw 2026.3.7.

Published Mar 9, 2026 · Analysis Oct 31, 2026

What an attacker can do

In security=allowlist mode, an allow-always decision saves the commands it finds in the approved line so they run without a prompt later. The tokenizer did not stop at an unquoted #. For a line such as benign warmup # && payload, the shell runs only benign warmup. The analysis still parsed the chained tail and persisted payload as an approved command.

The approver therefore trusted more than they saw run. A later call to the tail command would pass the allowlist without a prompt. The attacker is a caller who can submit commands and obtain an allow-always decision, whether a user or an agent steered by a prompt injection. It needs a person or policy to grant allow-always for the harmless first part.

This is an interpretation conflict between the analyzer and the runtime shell (CWE-436). Complexity is high and the score is medium, 5.0, because it needs an existing approval. The end result is that arbitrary chosen commands become permanently allowlisted without their own approval.

Who is affected

The npm package openclaw, versions <= 2026.3.2, where system.run runs with security=allowlist and users grant allow-always decisions. Check the version:

npm ls -g openclaw
openclaw --version

Existing allow-always entries saved by affected versions may include commands the operator never saw run.

openclaw

Ecosystem
npm
Affected
<= 2026.3.2
Fixed in
2026.3.7
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.3.7 or later, published to npm on March 8, 2026.

npm install -g [email protected]

Commit 939b184 adds isShellCommentStart in src/infra/exec-approvals-analysis.ts and makes splitShellArgs in src/utils/shell-argv.ts end tokenization at an unquoted #. Quoted # characters and # inside a word such as hi#tail still work. The sources give no workaround. After upgrading, audit stored allow-always entries and remove any you do not recognise.

How to tell if you were hit

Review the stored allow-always allowlist for entries that you never approved, especially commands that only ever appeared after a # in an approved line. Search system.run logs for command lines that contain an unquoted # followed by && or ;. Look for later runs of those tail commands that executed without a prompt. Beam records agent shell commands, so a run of a command that the approved line never executed would appear in its log.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

OpenClaw's system.run allowlist analysis did not honor POSIX shell comment semantics when deriving allow-always persistence entries.

A caller in security=allowlist mode who received an allow-always decision could submit a shell command whose tail was commented out at runtime, for example by using an unquoted # before a chained payload. The runtime shell would execute only the pre-comment portion, but allowlist persistence could still analyze and store the non-executed tail as a trusted follow-up command.

Latest published npm version: 2026.3.2

Fixed on main on March 7, 2026 in 939b18475d734ed75173f59507e3ebbdfe1992b7 by teaching shell tokenization and chain/pipeline analysis to stop at unquoted shell comments, so allow-always persistence now tracks only commands that the shell can actually execute. Normal real chained commands and quoted # literals continue to work.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Affected versions: <= 2026.3.2
  • Patched version: >= 2026.3.7

Fix Commit(s)

  • 939b18475d734ed75173f59507e3ebbdfe1992b7

Release Process Note

npm 2026.3.7 was published on March 8, 2026. This advisory is fixed in the released package.

Thanks @tdjackey for reporting.

Credited to tdjackey.

Questions

Is OpenClaw 2026.3.2 affected by this allow-always bug?

Yes. Versions up to and including 2026.3.2 are affected. Upgrade to 2026.3.7 or later.

Does the commented-out command run when first submitted?

No. The shell ignores the text after an unquoted #. The problem is that the analyzer stored it as a trusted command for later runs.

Do old allow-always entries get cleaned up by the upgrade?

The sources do not say so. Review the stored entries by hand after upgrading and remove any you did not intend.

Does the fix break quoted hash characters?

No. Tests show a # inside quotes stays literal, and a # inside a word like hi#tail is kept. Only an unquoted # that starts a word begins a comment.

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