CVE-2026-9277: shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`
Vulnerability summary
CVE-2026-9277 is a critical (CVSS 9.2) vulnerability in code-server. EPSS estimates a 0.79% chance of exploitation in the next 30 days, higher than 56.4% of scored vulnerabilities.
Severe, CVSS 9.2 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 03-11-2026)
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 2 · Related 4Timeline
- 22-05-2026PublishedVulnerability first disclosed.
- 14-09-2026Last modifiedVulnerability information updated.
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 metrics
11 scores · 7 sources · 2 versions- OSV · UbuntuEcosystem advisory · calculated9.2CriticalCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · DebianEcosystem advisory · calculated9.2CriticalCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- OSV · WolfiEcosystem advisory · calculated9.2CriticalCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · NpmEcosystem advisory · calculated9.2CriticalCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · ChainguardEcosystem advisory · calculated9.2CriticalCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- NVDNIST9.2CriticalCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- OSV · UbuntuEcosystem advisory · calculated8.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · NpmEcosystem advisory · calculated8.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- NVDNIST8.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
0.79%
Chance of exploitation in the next 30 days
Percentile
56%
Versus all other CVEs
30-day change
Decrease -0.03 pp
From 0.82% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-77Improper Neutralization of Special Elements used in a CommandThe product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
- CWE-78Improper Neutralization of Special Elements used in an OS CommandThe product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command before it is sent to a downstream component.
Affected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Chainguard32 products
- arangodb-3.11< 3.11.14.4-r9
- arangodb-3.12< 3.12.9.4-r2
- argo-workflows-ui-3.6< 3.6.19-r7
- code-server< 4.123.0-r2
- gemini-cli< 0.49.0-r4
Wolfi2 products
- code-server< 4.123.0-r2
- tileserver-gl< 5.6.0-r5
Debian1 product
- node-shell-quote< 1.7.4+~1.7.1-1+deb12u1 | < 1.7.4+~1.7.1-1+deb13u1 | < 1.8.4+~1.7.5-1
Npm1 product
- shell-quote≥ 1.1.0, < 1.8.4
Opensuse1 product
- python-pytest-html&distro=openSUSE Tumbleweed< 4.2.0-2.1
Ubuntu1 product
- node-shell-quote< 1.6.1+20160617-git72fb5a8ce29b-1ubuntu0.1~esm1 | < 1.7.3+~1.7.1-1ubuntu0.1~esm1 | < 1.7.4+~1.7.1-1ubuntu0.24.04.1 | < 1.7.4+~1.7.1-1ubuntu0.25.10.1 | All versions (No fix recorded) | < 1.8.3+~1.7.5-1ubuntu0.1~esm1
6 vendors · 38 products
References
47 links- github.com/ljharb/shell-quote/security/advisories/GHSA-w7jw-789q-3m8pVendor AdvisoryREPORTAdvisoryWEB