High severity · published May 22, 2026
CVE-2026-9277
shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`
8.1
CVSS
0.8%
EPSS
No
On KEV
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`.
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack vector
Network
Complexity
High
Privileges
None
User interaction
None
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.8% · higher than 56% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
SH
shell-quote ·
1.1.0 before 1.8.4 · source: vendor
CO
Cluster Observability Operator 1.5.0 · Red Hat
All versions, or not specified · source: CISA
C4
Cryostat 4 on RHEL 9 · Red Hat
All versions, or not specified · source: CISA
OL
OpenShift Lightspeed · Red Hat
All versions, or not specified · source: CISA
OP
OpenShift Pipelines · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Ansible Automation Platform 2 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Ansible Automation Platform 2.1 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Build of Podman Desktop · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Build of Podman Desktop - Tech Preview · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Developer Hub 1.10 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Developer Hub 1.9 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Discovery 2 · Red Hat
All versions, or not specified · source: CISA
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-9277
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-9277
github.com
https://github.com/ljharb/shell-quote
github.com
https://github.com/ljharb/shell-quote/commit/1518179
github.com
https://github.com/ljharb/shell-quote/security/advisories/GHSA-w7jw-789q-3m8p
www.npmjs.com
https://www.npmjs.com/package/shell-quote
www.openwall.com
http://www.openwall.com/lists/oss-security/2026/05/23/2
access.redhat.com
https://access.redhat.com/errata/RHSA-2026:26072
More from shell-quote
8.1
CVE-2026-102422
shell-quote `quote()` command injection via a line terminator in a token after a `{ comment }` token
