CVE-2026-9277
shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`
Also known as GHSA-w7jw-789q-3m8p
Mitigation
- Upgrade shell-quote to 1.8.4 or later.
Who should check
- Projects that depend on npm package shell-quote (>= 1.1.0, < 1.8.4)
- Anyone running shell-quote >= 1.1.0, < 1.8.4
Vulnerability facts
- Affected
- shell-quote >= 1.1.0, < 1.8.4
- Fixed in
- 1.8.4
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.2 (v4.0, CNA)CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Attack requirements: Present
- Privileges required: None
- User interaction: None
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- Confidentiality impact on other systems: None
- Integrity impact on other systems: None
- Availability impact on other systems: None
- EPSS
- 1.70% chance of exploitation in 30 days (percentile 78, 2026-11-26)
- CWE
- CWE-78, CWE-77
- Modified
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`.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| npm shell-quote | >= 1.1.0, < 1.8.4 | 1.8.4 | osv |
| shell-quote | >= 1.1.0, < 1.8.4 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-9277. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-9277.md Affected: shell-quote >= 1.1.0, < 1.8.4 Fixed in: 1.8.4 Steps: 1. Search this machine and project for shell-quote (npm), shell-quote: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://github.com/ljharb/shell-quote/security/advisories/GHSA-w7jw-789q-3m8p
- https://access.redhat.com/errata/RHSA-2026:28010
- https://access.redhat.com/errata/RHSA-2026:34342
- https://access.redhat.com/errata/RHSA-2026:50850
- https://access.redhat.com/errata/RHSA-2026:36754
- https://access.redhat.com/errata/RHSA-2026:33574
- https://access.redhat.com/errata/RHSA-2026:29197
- https://access.redhat.com/errata/RHSA-2026:41928
- https://access.redhat.com/errata/RHSA-2026:62410
- https://access.redhat.com/errata/RHSA-2026:56912
- https://access.redhat.com/errata/RHSA-2026:56854
- https://access.redhat.com/errata/RHSA-2026:60023
- https://access.redhat.com/errata/RHSA-2026:48699
- https://access.redhat.com/errata/RHSA-2026:40765
- https://access.redhat.com/errata/RHSA-2026:44263
- https://access.redhat.com/errata/RHSA-2026:34791
- https://access.redhat.com/errata/RHSA-2026:44267
- https://access.redhat.com/errata/RHSA-2026:29834
- https://access.redhat.com/errata/RHSA-2026:44237
- https://access.redhat.com/errata/RHSA-2026:29795
- https://access.redhat.com/errata/RHSA-2026:62260
- https://access.redhat.com/errata/RHSA-2026:26072
- https://access.redhat.com/errata/RHSA-2026:26080
- https://access.redhat.com/errata/RHSA-2026:26077
- https://access.redhat.com/errata/RHSA-2026:26079
- https://access.redhat.com/errata/RHSA-2026:26090
- https://access.redhat.com/errata/RHSA-2026:33683
- https://access.redhat.com/errata/RHSA-2026:30076
- https://access.redhat.com/errata/RHSA-2026:42796
- https://access.redhat.com/errata/RHSA-2026:41066
- https://access.redhat.com/errata/RHSA-2026:28571
- https://access.redhat.com/errata/RHSA-2026:26225
- https://nvd.nist.gov/vuln/detail/CVE-2026-9277
Other
- https://github.com/ljharb/shell-quote
- https://www.npmjs.com/package/shell-quote
- http://www.openwall.com/lists/oss-security/2026/05/23/2
- https://access.redhat.com/security/cve/CVE-2026-9277
- https://bugzilla.redhat.com/show_bug.cgi?id=2480741
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-9277.json
FAQ
Is CVE-2026-9277 being exploited?
There is no confirmed exploitation: CVE-2026-9277 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.70% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-9277?
Critical: CVSS 9.2 (v4.0, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2026-9277?
shell-quote >= 1.1.0, < 1.8.4.
Is there a fix for CVE-2026-9277?
Yes. Fixed in 1.8.4. Upgrade shell-quote to 1.8.4 or later.
How do I check if I'm affected by CVE-2026-9277?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.