CVE-2026-9277

Source
https://cve.org/CVERecord?id=CVE-2026-9277
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-9277.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-9277
Aliases
Downstream
Related
Published
2026-05-22T13:22:38.873Z
Modified
2026-07-10T04:02:36.471954541Z
Severity
  • 9.2 (Critical) CVSS_V4 - 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 CVSS Calculator
Summary
shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`
Details

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.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/9xxx/CVE-2026-9277.json",
    "cwe_ids": [
        "CWE-77",
        "CWE-78"
    ],
    "cna_assigner": "harborist"
}
References

Affected packages

Git / github.com/ljharb/shell-quote

Affected ranges

Type
GIT
Repo
https://github.com/ljharb/shell-quote
Events
Database specific
{
    "source": "AFFECTED_FIELD",
    "extracted_events": [
        {
            "introduced": "1.1.0"
        },
        {
            "fixed": "1.8.4"
        }
    ]
}

Affected versions

v1.*
v1.1.0
v1.2.0
v1.3.0
v1.3.1
v1.3.2
v1.3.3
v1.4.0
v1.4.1
v1.4.2
v1.4.3
v1.5.0
v1.6.0
v1.6.1
v1.6.2
v1.6.3
v1.7.0
v1.7.1
v1.7.2
v1.7.3
v1.7.4
v1.8.0
v1.8.1
v1.8.2
v1.8.3

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-9277.json"