Security Digest · Vulnerability record
CVE-2026-9277: shell-quote quote() does not escape newlines in object .op values
shell-quote's quote() function did not validate object-token inputs against the operator model used by parse().
CVSS 9.2 Critical EPSS 0.8% · p57
Should you act?
Critical and remotely reachable
No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.8%, percentile 57: FIRST’s model estimates a 0.8% chance of exploitation activity in the next 30 days, higher than 57% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes
shell-quote(npm) >= 1.1.0, <= 1.8.3, fixed in 1.8.4. Check your lockfile, including transitive dependencies.
What it is
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.
From the GitHub advisory
Summary
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 \n as a command separator, so any content after it would execute as a second command.
The vulnerable code path is reachable in two ways. Neither requires the parser to misbehave — parse() only emits ops from a fixed control set — but both are documented API surface:
1. Direct construction. A caller builds { op: '...\n...' } from external input (e.g. a deserialized argument array) and passes it to quote(). 2. envFn return. parse(cmd, envFn) is documented to splice the return value of envFn into the result array when it is an object. An attacker-influenced data source consulted by envFn can introduce an object token whose .op reaches quote().
Impact
Weakness type: CWE-78, CWE-77.
Product: shell-quote (npm) · Assigned by: harborist · Published: 2026-05-22
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| npm | shell-quote | >= 1.1.0, <= 1.8.3 | 1.8.4 |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| shell-quote | 1.1.0 < 1.8.4 |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| harborist | 3.1 | 8.1 High | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| harborist | 4.0 | 9.2 Critical | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| redhat-SADP | 3.1 | 8.1 High | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 4.0 | 9.2 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
- Attack vector: network (remotely reachable)
- Attack complexity: low
- Attack requirements: present (depends on deployment conditions)
- Privileges required: none (no login)
- User interaction: none
CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.
Exploitation and urgency
- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none, automatable no, technical impact total.
- FIRST EPSS (model of 2026-10-21): 0.82% probability of exploitation activity in the next 30 days; percentile 57.
Timeline
- — CVE record published by harborist
- — GitHub-reviewed advisory GHSA-w7jw-789q-3m8p published (critical)
- — CVE record last updated
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vendor and project advisories, patches
- GHSA-w7jw-789q-3m8p github.com
- Fix commit github.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
- access.redhat.com access.redhat.com
Vulnerability records
- GitHub Advisory GHSA-w7jw-789q-3m8p github.com
- CVE.org record CVE-2026-9277 cve.org
- NVD entry CVE-2026-9277 nvd.nist.gov
Other references from the CVE record and advisory
- github.com github.com
- npmjs.com npmjs.com
- openwall.com openwall.com
- access.redhat.com access.redhat.com
- RHBZ#2480741 bugzilla.redhat.com
- security.access.redhat.com security.access.redhat.com