CVE-2026-9277
CVE-2026-9277
- CVSS v3
- 8.1 High
- Public exploits
- 1 repository
- EPSS
- 0.008 · 57.1th percentile
- Published
- 2026-05-22
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`.
Vulnerability class: Command Injection (OS Command Injection)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 8.1 (High). Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
- Attack Vector
- Network
AV:N - Attack Complexity
- High
AC:H - Privileges Required
- None
PR:N - User Interaction
- None
UI:N - Scope
- Unchanged
S:U - Confidentiality
- High
C:H - Integrity
- High
I:H - Availability
- High
A:H
EPSS exploit prediction
EPSS 0.008, 57.1th percentile (last changed ); unchanged over 30 days. About EPSS.
Weakness classification (CWE)
Public exploits and proof-of-concept code
1 public repository with exploit or proof-of-concept code for this CVE:
- DylanZahedi/CVE-2026-9277 (2 stars, last pushed 2026-07-12)
References
- GHSA-w7jw-789q-3m8p (vendor-advisory)
- Fix commit (patch)
- github.com/ljharb/shell-quote (product)
- www.npmjs.com/package/shell-quote (product)
- www.openwall.com/lists/oss-security/2026/05/23/2
- access.redhat.com/errata/RHSA-2026:26072
- access.redhat.com/errata/RHSA-2026:26077
- access.redhat.com/errata/RHSA-2026:26079
- access.redhat.com/errata/RHSA-2026:26080
- access.redhat.com/errata/RHSA-2026:26090