CVE-2026-29783
Description
The shell tool within GitHub Copilot CLI versions prior to and including 0.0.422 can allow arbitrary code execution through crafted bash parameter expansion patterns. An attacker who can influence the commands executed by the agent (e.g., via prompt injection through repository files, MCP server responses, or user instructions) can exploit bash parameter transformation operators to execute hidden commands, bypassing the safety assessment that classifies commands as "read-only." This has been patched in version 0.0.423.
The vulnerability stems from how the CLI's shell safety assessment evaluates commands before execution. The safety layer parses and classifies shell commands as either read-only (safe) or write-capable (requires user approval). However, several bash parameter expansion features can embed executable code within arguments to otherwise read-only commands, causing them to appear safe while actually performing arbitrary operations.
The specific dangerous patterns are ${var@P}, ${var=value} / ${var:=value}, ${!var}, and nested $(cmd) or <(cmd) inside ${...} expansions. An attacker who can influence command text sent to the shell tool - for example, through prompt injection via malicious repository content (README files, code comments, issue bodies), compromised or malicious MCP server responses, or crafted user instructions containing obfuscated commands - could achieve arbitrary code execution on the user's workstation. This is possible even in permission modes that require user approval for write operations, since the commands can appear to use only read-only utilities to ultimately trigger write operations. Successful exploitation could lead to data exfiltration, file modification, or further system compromise.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
CVE-2026-29783: GitHub Copilot CLI shell tool allows arbitrary code execution via crafted bash parameter expansion patterns, bypassing safety checks.
Vulnerability
Overview CVE-2026-29783 affects the shell tool in GitHub Copilot CLI versions up to 0.0.422. The vulnerability allows an attacker to achieve arbitrary code execution by crafting bash parameter expansion patterns that bypass the tool's safety assessment. The safety layer classifies commands as read-only or write-capable, but specific bash expansions can embed executable code within arguments to otherwise harmless commands, making them appear safe while actually performing arbitrary operations [1][3].
Exploitation
Mechanism The dangerous patterns include ${var@P}, ${var=value}, ${!var}, and nested $(cmd) or < (cmd) inside ${...} expansions [1]. An attacker can influence the command text through prompt injection via malicious repository content (e.g., README files, code comments, issue bodies), compromised MCP server responses, or crafted user instructions [1][3]. A proof-of-concept shows that a command like echo ${a="$"}${b="$a(touch /tmp/pwned)"}${b@P} appears to run a harmless echo but actually executes touch /tmp/pwned via chained parameter expansion [3].
Impact
Successful exploitation could lead to data exfiltration, file modification, or further system compromise. This can occur even in permission modes that require user approval for write operations, as the commands can be crafted to use only read- only utilities while ultimately triggering write operations [1].
Mitigation
The vulnerability has been patched in version 0.0.423, which adds user prompts for shell commands with potentially dangerous expansion or substitution use cases and additional guardrails for malicious exploits [4]. Users should update to at least version 0.0.423 [1][4].
AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
@github/copilotnpm | < 0.0.423 | 0.0.423 |
Affected products
2- Range: <=0.0.422
- github/copilot-cliv5Range: <= 0.0.422
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/github/copilot-cli/security/advisories/GHSA-g8r9-g2v8-jv6fnvdExploitVendor AdvisoryWEB
- github.com/advisories/GHSA-g8r9-g2v8-jv6fghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-29783ghsaADVISORY
- github.com/github/copilot-cli/releases/tag/v0.0.423nvdRelease NotesWEB
News mentions
0No linked articles in our index yet.