Skip to main content
VulnerabilityPublished Updated

CVE-2026-9277: shell-quote · OS Command Injection

Affects shell-quoteSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 8.1 High : upgrade to 1.8.4 soon.

Data as of 30 Oct 2026, 11:52 UTC

CVSS 3.1 base score
8.1High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.7% chance of exploitation in 30 days – higher than 56% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 1.8.4
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 22 May 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: evidence found.

    Public exploit code: GitHub proofs of concept

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), GitHub proofs of concept, the Metasploit, Exploit-DB and nuclei-templates index as of 24 Oct 2026.

What to do

Upgrade shell-quote to 1.8.4.

Affected software

ProductAffectedFixed in
shell-quoteAffected
  • >=1.1.0 <1.8.4
Fixed in
  • 1.8.4
npmshell-quotepkg:npm/shell-quoteOther threatsAffected
  • =1.1.0
Fixed in–
npmshell-quotepkg:npm/shell-quoteOther threatsAffected
  • >=1.1.0 <1.8.4
Fixed in
  • 1.8.4

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

An official fix is available and has been released that enforces strict validation of the .op field and forbids line terminators in tokens. Users should upgrade to the fixed version of shell-quote. The Red Hat advisory confirms the availability of a security update addressing this issue. No additional mitigations are specified beyond applying the official patch.

Description

shell-quote's `quote()` function did not validate object-token inputs against the operator model used by `parse()`. The `.op` field was backslash-escaped character by character using `/(.)/g`, which in JavaScript does not match line terminators (\n, \r, U+2028, U+2029). A line terminator in `.op` therefore passed through unescaped into the output; POSIX shells treat a literal newline as a command separator, so any content after it would execute as a second command. The vulnerable code path is reachable in two ways: (1) direct construction of `{ op: '...\n...' }` from external input, and (2) via `parse(cmd, envFn)` when `envFn` returns object tokens whose `.op` is attacker-influenced. Both are documented API surface. Fixed by replacing the per-character escape with strict shape validation: `.op` must match the parser's control-operator allowlist; `{ op: 'glob', pattern }` validates `pattern` and forbids line terminators; `{ comment }` validates `comment` and forbids line terminators; any other object shape throws `TypeError`.

References

Community reviews

Loading reviews…