GitHub Copilot CLI
CVE-2026-29783
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconPlant crafted expansion in repo/MCP/instructions
-
DeliveryVictim runs Copilot CLI on tainted source
-
ExploitAgent emits echo with hidden ${...@P} payload
-
InstallSafety classifier marks command read-only
-
C2Bash expands payload and executes $(cmd)
-
ExecuteAttacker code runs as user
-
ImpactData exfiltration or file modification
Vulnerability Assessment
| Weakness |
CWE
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The victim must be running GitHub Copilot CLI at version <=0.0.422 and must invoke the agent against an attacker-influenced input channel: a repository whose files (README, code comments, issue bodies) the agent reads, an MCP server whose responses the agent consumes, or pasted user instructions containing the crafted bash expansion. The crafted command must use one of the specific patterns ${var@P}, ${var=value}/${var:=value}, ${!var}, or $(cmd)/<(cmd) nested inside ${...} so it bypasses the read-only classifier. Limiting factors per the CVSS 4.0 vector: User Interaction is Active (UI:A) - the user must actually run the agent against the poisoned content, and in permission modes that auto-approve only read-only commands the misclassified command then runs without further approval; Attack Requirements:Present (AT:P) reflects the need to land malicious content into an ingested channel; no authentication to the victim system is required (PR:N) because exploitation runs in the user's existing shell context. The flaw is not exploitable on 0.0.423+ where dangerous expansion patterns now trigger an explicit prompt. |
| Impact | CVSS 4.0 vector AV:N/AC:L/AT:P/PR:N/UI:A scores 7.5 - network reachable and unauthenticated, but with Attack Requirements:Present (the attacker must get malicious content into a channel the agent reads) and User Interaction:Active (the user must run Copilot CLI against that content, and in some modes approve the command), which together throttle exploitability. EPSS is very low at 0.10% (28th percentile) and there is no CISA KEV listing, consistent with a freshly-patched issue rather than mass exploitation. However, VC:H/VI:H/VA:H reflects full local compromise on success, the GHSA advisory includes a working PoC, and the realistic delivery path (poisoned README, issue body, code comment, or compromised MCP server) is plausible in any developer workflow that runs Copilot CLI against untrusted repositories - so this should be treated as a real priority for anyone using the affected versions, not a theoretical high-CVSS-only issue. Note: the CVSS UI:A and AT:P attributes are CVSS 4.0-specific and have no direct CVSS 3.1 analogue, so risk scoring tools that consume only v3.1 may understate the user-interaction gate. |
| Exploit ScenarioDerived | An attacker plants a poisoned README, issue body, or MCP server response containing an instruction such as 'run |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – May 18, 2026
Arbitrary code execution in GitHub Copilot CLI versions <=0.0.422 allows attackers to bypass the agent's shell command safety classifier using bash parameter expansion operators (${var@P}, ${var=value}, ${!var}, and nested $(cmd)/<(cmd)). Attackers influencing agent inputs via prompt injection through repository files, MCP server responses, or user instructions can execute hidden commands disguised as read-only operations on the user's workstation. A detailed proof-of-concept is published in the GHSA advisory; EPSS is low (0.10%, 28th percentile) and the issue is not in CISA KEV, so no public exploit identified at time of analysis beyond the vendor-published PoC.
Earlier versions of this analysis (1)
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.
RemediationAI
Vendor-released patch: upgrade @github/copilot to 0.0.423 or later (npm install -g @github/copilot@0.0.423), per the release notes at https://github.com/github/copilot-cli/releases/tag/v0.0.423 and advisory GHSA-g8r9-g2v8-jv6f. The 0.0.423 release adds explicit user prompting and guardrails for shell commands containing potentially dangerous expansion or substitution patterns. If immediate upgrade is not possible, compensating controls include: running Copilot CLI only inside an ephemeral container or sandbox so an injected command cannot reach the host workstation (trade-off: complicates local file edits and persistent state); avoiding pointing the agent at untrusted repositories, MCP servers, or pasted instructions until upgraded (trade-off: blocks legitimate exploratory use); and disabling or vetting third-party MCP servers configured for the CLI (trade-off: loses MCP-provided functionality). Generic shell-allowlisting at the OS level is not a reliable mitigation because the attack hides behind ostensibly safe utilities like echo.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
GitHub Copilot CLI is an npm-distributed package (@github/copilot) that exposes an AI coding agent in the terminal with a shell tool gated by a safety classifier that labels commands as read-only or write-capable. The vulnerability (CWE-78, OS Command Injection) abuses bash's parameter expansion grammar: the @P prompt transformation re-evaluates a variable's contents as if it were a PS1 prompt (which performs command substitution), assignment forms ${var=value}/${var:=value} let an attacker stage payloads across multiple expansions, ${!var} performs indirect dereferencing, and nested $(cmd)/<(cmd) within default-value expansions trigger subshell execution. The classifier inspected the outer command (e.g., echo) but did not recursively analyze parameter expansion side effects, so a command like 'echo ${a="$"}${b="$a(touch /tmp/pwned)"}${b@P}' parsed as a safe echo while actually executing the embedded touch.
Know when Github gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Primary rating from Vendor (github) · only source for this CVE.
CVSS VectorVendor: github
Lifecycle Timeline
4DescriptionCVE.org
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.
Executive ViewAI
GitHub Copilot CLI versions 0.0.422 and earlier contain a code execution vulnerability allowing attackers to bypass safety controls through prompt injection in repositories or integrated services, potentially compromising developer systems and organizational source code. Publicly available exploit code has been disclosed in the vendor advisory. Organizations using affected versions should prioritize updating to prevent unauthorized access to code repositories and development infrastructure.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
Supply chain vulnerability in Eclipse Theia GitHub Actions workflow. The preview.yml workflow uses pull_request_target w
Supply chain attack vector in OpenLIT GitHub Actions workflows. The pull_request_target trigger with checkout enables ma
Eigent multi-agent workflow CI pipeline (ci.yml) uses pull_request_target with checkout of untrusted PR code, enabling a
Apache bRPC versions before 1.15.0 contain a remote command injection vulnerability in the heap profiler built-in servic
An unsafe reflection vulnerability was identified in GitHub Enterprise Server that could lead to reflection injection. R
cmark-gfm is GitHub's extended version of the C reference implementation of CommonMark. Rated critical severity (CVSS 9.
An improper verification of cryptographic signature vulnerability was identified in GitHub Enterprise Server that allowe
Unauthenticated infrastructure overwrite in Hoppscotch API development ecosystem before 2026.2.0. Attackers can overwrit
A exposure of sensitive information vulnerability exists in Jenkins GitHub Plugin 1.29.1 and earlier in GitHubTokenCrede
OneUptime versions prior to 10.0.19 allow unauthenticated attackers to hijack GitHub App integrations across projects by
PolarLearn versions 0-PRERELEASE-15 and earlier lack proper state parameter validation in OAuth 2.0 authentication, enab
Path traversal in esm.sh CDN prior to version 0.0.0-20260116051925-c62ab83c589e allows unauthenticated remote attackers
GHSA-g8r9-g2v8-jv6f
NVD
CVE.org
EPSS
VulDB
Exploit-DB