
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-29783 is an OS command injection vulnerability in GitHub Copilot CLI's shell tool that allows arbitrary code execution through crafted bash parameter expansion patterns. It affects all versions of the @github/copilot npm package at or below 0.0.422, and was disclosed and patched on March 6, 2026. An attacker who can influence commands executed by the agent — via prompt injection through repository files, MCP server responses, or user instructions — can exploit bash parameter transformation operators to bypass the CLI's safety assessment that classifies commands as "read-only." The vulnerability carries a CVSS v3.1 base score of 7.8 (High) and a CVSS v4.0 base score of 7.5 (High) (GitHub Advisory, Github Advisory).
The root cause is improper neutralization of special elements used in OS commands (CWE-78). The CLI's shell safety layer parses and classifies commands as either read-only (auto-approved) or write-capable (requires user approval), but fails to account for several bash parameter expansion features that can embed executable code within otherwise benign-looking arguments. The specific dangerous patterns are: ${var@P} (prompt expansion that evaluates embedded command substitutions), ${var=value} / ${var:=value} (assignment side-effects chainable with @P), ${!var} (indirect expansion for dynamic command construction), and nested $(cmd) or <(cmd) inside ${...} expansions. Because the safety assessment sees only the outer command (e.g., echo) and classifies it as read-only, the hidden payload executes without user confirmation — even in permission modes that normally require approval for write operations (GitHub Advisory).
Successful exploitation results in arbitrary code execution on the victim's workstation with the full privileges of the user running GitHub Copilot CLI. An attacker can achieve data exfiltration (stealing source code, credentials, SSH keys, or other sensitive files), unauthorized file modification or deletion, installation of malware or backdoors for persistent access, and potential lateral movement to connected systems or cloud environments. The attack surface is particularly broad because malicious payloads can be embedded in public repository content (README files, code comments, issue bodies), making detection difficult and enabling supply-chain-style attacks against developers (GitHub Advisory, Github Advisory).
A concrete proof-of-concept exploit is publicly available in the GitHub Security Advisory, demonstrating the vulnerability with a runnable bash payload (echo ${a="$"}${b="$a(touch /tmp/pwned)"}${b@P}) that executes arbitrary commands while appearing to be a harmless echo invocation (GitHub Advisory). As of the time of reporting, there is no evidence of active in-the-wild exploitation or threat actor attribution. The EPSS score is approximately 0.065–0.077%, placing it in the lower percentiles for near-term exploitation probability. The vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (Github Advisory).
echo ${a="$"}${b="$a(touch /tmp/pwned)"}${b@P}${a="$"} assigns the literal $ to variable a.${b="$a(touch /tmp/pwned)"} expands $a to $, building the string $(touch /tmp/pwned) and assigning it to b.${b@P} applies prompt expansion to b, causing bash to evaluate the embedded $(touch /tmp/pwned) command substitution.echo as read-only and auto-approves execution without user confirmation.touch /tmp/pwned, or a more destructive payload such as a reverse shell or data exfiltration script) executes on the victim's workstation with the user's privileges — even in permission modes that normally require approval for write operations (GitHub Advisory)./tmp/ or other writable directories (e.g., /tmp/pwned); new or modified cron jobs, shell startup files (.bashrc, .zshrc, .profile), or SSH authorized_keys files; presence of unknown scripts or binaries in user home or temp directories.bash, sh, curl, wget, python, nc) performing network connections or file operations; unexpected touch, cp, rm, or data-staging commands executed in the context of a Copilot CLI session..bash_history, .zsh_history) containing obfuscated parameter expansion patterns such as ${var@P}, ${var:=value}, or nested $(cmd) inside ${...}; audit logs showing file creation or modification events triggered by the Copilot CLI process (GitHub Advisory).The primary remediation is to upgrade GitHub Copilot CLI (@github/copilot npm package) to version 0.0.423 or later, released March 6, 2026 (GitHub Release). The fix implements three defense layers: parse-time detection that downgrades commands with dangerous expansion patterns (@P, =, :=, !, nested substitutions) from read-only to write-capable; unconditional blocking of such commands at the tool execution layer regardless of permission mode (including --yolo/autopilot); and system prompt hardening instructing the LLM to refuse executing commands with these patterns. As interim workarounds, users should avoid working in untrusted repositories or with untrusted MCP servers, and carefully review any agent-suggested shell commands containing complex parameter expansion before approving execution (GitHub Advisory).
The advisory was published by GitHub maintainer andyfeller on March 6, 2026, and received community attention on social platforms including Bluesky and Mastodon/infosec.exchange shortly after disclosure. Red Hat also tracked the vulnerability under their security advisory system. The vulnerability attracted broader interest given its relevance to AI-assisted development tools and the emerging threat of prompt injection attacks against LLM-powered CLI agents (GitHub Advisory, Red Hat CVE).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."