{"id":"CVE-2026-9277","published":"2026-05-22T13:22:38Z","modified":"2026-09-14T12:04:27Z","title":"shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`","vendor":null,"product":null,"tier":"tail","description":{"text":"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`.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01419,"percentile":0.73493,"provenance":"source"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"},{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"}],"references":[{"url":"https://github.com/ljharb/shell-quote/security/advisories/GHSA-w7jw-789q-3m8p","tags":["vendor-advisory"]},{"url":"https://github.com/ljharb/shell-quote/commit/1518179","tags":["patch"]},{"url":"https://github.com/ljharb/shell-quote","tags":["product"]},{"url":"https://www.npmjs.com/package/shell-quote","tags":["product"]},{"url":"http://www.openwall.com/lists/oss-security/2026/05/23/2","tags":[]},{"url":"https://access.redhat.com/security/cve/CVE-2026-9277","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2480741","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-9277.json","tags":["x_sadp-csaf-vex"]},{"url":"https://access.redhat.com/errata/RHSA-2026:28010","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:34342","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:50850","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:36754","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:33574","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:29197","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:41928","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:62410","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:56912","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:56854","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:60023","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:48699","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:40765","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:44263","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:34791","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:44267","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:29834","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:44237","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:29795","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:62260","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26072","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26080","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26077","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26079","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26090","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:33683","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:30076","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:42796","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:41066","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:28571","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:26225","tags":["vendor-advisory","x_refsource_REDHAT"]}],"priority":{"score":25.4,"factors":[{"name":"EPSS percentile","points":14.7},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.67}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-06-15","earliestUrl":"https://github.com/DylanZahedi/CVE-2026-9277","repos":[{"name":"DylanZahedi/CVE-2026-9277","url":"https://github.com/DylanZahedi/CVE-2026-9277","stars":2,"created":"2026-06-15"}]},"first":{"date":"2026-06-15","source":"PoC-in-GitHub","url":"https://github.com/DylanZahedi/CVE-2026-9277"},"provenance":"source"},"affectedVersions":[{"vendor":null,"product":"shell-quote","versions":[">= 1.1.0, < 1.8.4"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-05-22T14:17:31.964845Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"shell-quote","vulnerableRanges":[">=1.1.0, <1.8.4"],"patched":["1.8.4"],"from":["GHSA-w7jw-789q-3m8p"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-31440","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2016-10541","published":"2018-05-31","fixed":"1.6.1","kev":false},{"cve":"CVE-2021-42740","published":"2021-10-21","fixed":"1.7.3","kev":false},{"cve":"CVE-2026-9277","published":"2026-05-22","fixed":"1.8.4","kev":false},{"cve":"CVE-2026-13311","published":"2026-06-25","fixed":"1.9.0","kev":false,"link":{"from":"CVE-2026-9277","to":"CVE-2026-13311","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:shell-quote","fromFixed":"1.8.4","toFixed":"1.9.0","daysApart":34}]}},{"cve":"CVE-2026-102422","published":"2026-09-29","fixed":"1.11.0","kev":false}],"package":"npm:shell-quote"}}