{"id":"CVE-2026-102422","state":"PUBLISHED","title":"shell-quote `quote()` command injection via a line terminator in a token after a `{ comment }` token","description":"shell-quote's `quote()` function emits a `{ comment }` token as `#` followed by its text, which comments out the rest of the shell line, including the opening quote of any later string token. A line terminator (\\n, \\r, U+2028, U+2029) in that later string therefore ends the comment, and the rest of the string is parsed as shell input: `quote(['echo', 'ok', { comment: 'x' }, 'a\\nid;#'])` runs `id` in sh, bash, dash, ksh and zsh. `parse()` emits a comment token for a `#` in the middle of a word (for example `http://example.com/#frag`), so callers that combine `parse()` output with another untrusted string, such as `quote(parse(untrustedCommand).concat(untrustedArg))`, are affected. The fix for CVE-2026-9277 rejected line terminators in the comment's own text, but not in the tokens after it. Fixed in 1.11.0: `quote()` throws a `TypeError` when a string after a `{ comment }` token contains a line terminator.","publishedAt":"2026-09-29T03:47:36.376Z","updatedAt":"2026-09-30T15:18:32.135Z","severity":{"score":9.2,"label":"Critical","version":"4.0","vector":"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","source":"harborist"},"assigner":"harborist","products":["shell-quote"],"affected":[{"product":"shell-quote","packageName":"shell-quote","defaultStatus":"unaffected","versions":[{"version":"1.8.4","status":"affected","lessThan":"1.11.0","versionType":"semver"}],"collectionURL":"https://www.npmjs.com/package/shell-quote","repo":"https://github.com/ljharb/shell-quote","programFiles":["quote.js"],"programRoutines":[{"name":"quote"}]}],"references":["https://github.com/ljharb/shell-quote/security/advisories/GHSA-pqg4-j6r4-53mv","https://github.com/ljharb/shell-quote/commit/6002b2ed90c6b83095eb272b6b0adaf3a172b0bc","https://github.com/ljharb/shell-quote","https://www.npmjs.com/package/shell-quote"],"weaknesses":["CWE-78"],"ingestedAt":"2026-10-29T20:10:13.529Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/102xxx/CVE-2026-102422.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-102422","state":"PUBLISHED","datePublished":"2026-09-29T03:47:36.376Z","dateUpdated":"2026-09-30T15:18:32.135Z","assignerShortName":"harborist","assignerOrgId":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","dateReserved":"2026-09-29T03:43:27.967Z"},"containers":{"cna":{"title":"shell-quote `quote()` command injection via a line terminator in a token after a `{ comment }` token","descriptions":[{"lang":"en","value":"shell-quote's `quote()` function emits a `{ comment }` token as `#` followed by its text, which comments out the rest of the shell line, including the opening quote of any later string token. A line terminator (\\n, \\r, U+2028, U+2029) in that later string therefore ends the comment, and the rest of the string is parsed as shell input: `quote(['echo', 'ok', { comment: 'x' }, 'a\\nid;#'])` runs `id` in sh, bash, dash, ksh and zsh. `parse()` emits a comment token for a `#` in the middle of a word (for example `http://example.com/#frag`), so callers that combine `parse()` output with another untrusted string, such as `quote(parse(untrustedCommand).concat(untrustedArg))`, are affected. The fix for CVE-2026-9277 rejected line terminators in the comment's own text, but not in the tokens after it. Fixed in 1.11.0: `quote()` throws a `TypeError` when a string after a `{ comment }` token contains a line terminator."}],"affected":[{"product":"shell-quote","packageName":"shell-quote","defaultStatus":"unaffected","versions":[{"version":"1.8.4","status":"affected","lessThan":"1.11.0","versionType":"semver"}],"collectionURL":"https://www.npmjs.com/package/shell-quote","repo":"https://github.com/ljharb/shell-quote","programFiles":["quote.js"],"programRoutines":[{"name":"quote"}]}],"references":[{"url":"https://github.com/ljharb/shell-quote/security/advisories/GHSA-pqg4-j6r4-53mv","name":"GHSA-pqg4-j6r4-53mv","tags":["vendor-advisory"]},{"url":"https://github.com/ljharb/shell-quote/commit/6002b2ed90c6b83095eb272b6b0adaf3a172b0bc","name":"Fix commit","tags":["patch"]},{"url":"https://github.com/ljharb/shell-quote","tags":["product"]},{"url":"https://www.npmjs.com/package/shell-quote","tags":["product"]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV3_1":{"version":"3.1","attackVector":"NETWORK","attackComplexity":"HIGH","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseSeverity":"HIGH","baseScore":8.1,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"}},{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"HIGH","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"CRITICAL","baseScore":9.2,"vectorString":"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"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-78","lang":"en","description":"CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"harborist","orgId":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","dateUpdated":"2026-09-29T03:47:36.376Z"},"credits":[{"lang":"en","value":"Eurico Nicacio (@euriconicacio)","type":"finder"},{"lang":"en","value":"Jordan Harband (@ljharb)","type":"remediation developer"}],"source":{"advisory":"GHSA-pqg4-j6r4-53mv","discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-09-30T15:18:10.710251Z","id":"CVE-2026-102422","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-09-30T15:18:32.135Z"}}]}}}