shell-quote
shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`
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`.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 1.1.0, < 1.8.4
Fixed in 1.8.4
Mitigation
Upgrade shell-quote to 1.8.4 or later.
References
Timeline
Days relative to CVE publicationFirst public PoC 24 days after publication; not in CISA KEV. First PoC: DylanZahedi/CVE-2026-9277 (created 15 Jun 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| DylanZahedi/CVE-2026-9277 | 15 Jun 2026 +24 d | 2 | PoC
Flags · score 30
Below the suspicion threshold (50); does not change the assessment. |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
PoC characteristics
What to hunt for in your logs · from 1 PoC repoPOST /
- Body markers
"op": ";\nid""op": ";\nwhoami""op": ";\nsleep"op": ";\ncurl""op": ";\nwget""op": ";\nnslookup"inapplication/json- PoC User-Agent
python-requests (default)- Seen in
- 1 repo: DylanZahedi/CVE-2026-9277
- Evidence
- DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:58 DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:94 DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:135 DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:150 DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:158
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET any (msg:"GG PoC-Monitor CVE-2026-9277 shell-quote exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.request_body; content:"|22|op|22|: |22||3b||5c|nid|22|"; http.request_body; content:"|22|op|22|: |22||3b||5c|nwhoami|22|"; http.request_body; content:"|22|op|22|: |22||3b||5c|nsleep"; http.request_body; content:"|22|op|22|: |22||3b||5c|ncurl|22|"; http.request_body; content:"|22|op|22|: |22||3b||5c|nwget|22|"; http.request_body; content:"|22|op|22|: |22||3b||5c|nnslookup|22|"; reference:url,poc.griffinguard.io/cve/CVE-2026-9277; classtype:web-application-attack; sid:9259537; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: shell-quote exploit attempt (CVE-2026-9277)
id: gg-pocmon-cve-2026-9277-9259537
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-9277. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-9277
logsource:
category: webserver
detection:
selection:
cs-method: POST
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2026.9277