# CVE-2026-29783: GitHub Copilot CLI allows for dangerous shell expansion patterns that enable arbitrary command execution

> Attackers can execute arbitrary commands via bash expansion patterns in GitHub Copilot CLI, bypassing safety checks and compromising user workstations.

- **Severity:** High 7.5 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Mar 2026
- **Updated:** 11 Mar 2026
- **Also known as:** GHSA-g8r9-g2v8-jv6f

## What is CVE-2026-29783?

CVE-2026-29783 is a high-severity command injection vulnerability in github copilot-cli, published on 6 Mar 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2026-29783?

2 open source packages ship an affected version, including @github/copilot. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@github/copilot` | npm | All versions | 0.0.423 |
| `@github/copilot` | npm | All versions | 0.0.423 |

Products: Github Copilot Command Line Interface.

## How do I fix CVE-2026-29783?

Upgrade @github/copilot to 0.0.423 or later.

## Is CVE-2026-29783 being exploited?

There is no known exploitation of CVE-2026-29783 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-29783 and fix it if it is affected.

What it is: CVE-2026-29783 is a high-severity command injection vulnerability in github copilot-cli, published on 6 Mar 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-29783 in the wild and no public exploit code.

Affected packages and fixed versions:
- @github/copilot (npm): affected all versions; fixed in 0.0.423
- @github/copilot (npm): affected all versions; fixed in 0.0.423

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-29783/ (Markdown: https://insights.sbomify.com/CVE-2026-29783/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-29783
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-29783
- OSV: https://osv.dev/vulnerability/CVE-2026-29783

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-29783/
Summaries are generated and may contain mistakes; the official description above is the record.
