8.5high
GitHub Copilot CLI: Nested Bare Repository Can Execute Arbitrary Commands via core.fsmonitor
- Severity
- 8.5high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.29% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-9ccr-r5hg-74gf
Description
GitHub Copilot CLI brings AI-powered coding assistance directly to your command line. Prior to 1.0.43, a security vulnerability has been identified in GitHub Copilot CLI where a malicious bare git repository nested inside a project directory can achieve arbitrary code execution when the agent performs git operations. By exploiting git's automatic bare repository discovery during directory traversal, an attacker can set core.fsmonitor or other executable config keys to run arbitrary commands without user awareness or approval. The vulnerability arises because git's core.fsmonitor config key (and 15+ similar keys such as core.hookspath, diff.external, merge.tool, etc.) can specify arbitrary shell commands that git will execute as part of normal operations like status, diff, or rev-parse. This vulnerability is fixed in 1.0.43.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| github copilot-cli | < 1.0.43, before 1.0.43 | CVE List, NVD |
| @github/copilot (npm) | before 1.0.43 | GitHub Advisory Database |
All scores
| GitHub_M | 8.5high CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| GitHub | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
GitHub Copilot CLI brings AI-powered coding assistance directly to your command line. Prior to 1.0.43, a security vulnerability has been identified in GitHub Copilot CLI where a malicious bare git repository nested inside a project directory can achieve arbitrary code execution when the agent performs git operations. By exploiting git's automatic bare repository discovery during directory traversal, an attacker can set core.fsmonitor or other executable config keys to run arbitrary commands without user awareness or approval. The vulnerability arises because git's core.fsmonitor config key (and 15+ similar keys such as core.hookspath, diff.external, merge.tool, etc.) can specify arbitrary shell commands that git will execute as part of normal operations like status, diff, or rev-parse. This vulnerability is fixed in 1.0.43.
GitHub Advisory Database
Summary
A security vulnerability has been identified in GitHub Copilot CLI where a malicious bare git repository nested inside a project directory can achieve arbitrary code execution when the agent performs git operations. By exploiting git's automatic bare repository discovery during directory traversal, an attacker can set core.fsmonitor or other executable config keys to run arbitrary commands without user awareness or approval.
Details
Git supports bare repositories — repositories without a working tree — which can be discovered automatically when git traverses the directory hierarchy looking for a .git directory. When git discovers a bare repository, it reads and applies its configuration, including keys that specify external commands to execute.
The vulnerability arises because git's core.fsmonitor config key (and 15+ similar keys such as core.hookspath, diff.external, merge.tool, etc.) can specify arbitrary shell commands that git will execute as part of normal operations like status, diff, or rev-parse.
Attack Scenario
An attacker can exploit this by:
- Creating a bare git repository nested inside a seemingly normal project directory (e.g.,
vendor/malicious.git/or a deeply nested subdirectory) - Configuring
core.fsmonitor(or similar keys) in that bare repository to execute a malicious command - When GitHub Copilot CLI performs any git operation that traverses into or through that directory, git auto-discovers the bare repository, reads its config, and executes the attacker's command
This can occur when:
- The agent navigates into a subdirectory containing the buried bare repo
- The agent runs
git status,git diff, or other routine git commands - The agent uses tools like
greporglobthat may trigger git operations in subdirectories
Prior to the fix, the CLI had no protection against git auto-discovering bare repositories during directory traversal.
Impact
An attacker who can place a malicious bare repository inside a project — for example, through:
- A pull request adding a directory that contains a bare repository
- A compromised or malicious dependency that includes a bare repository
- A cloned repository that already contains nested bare repositories
— could achieve arbitrary code execution on the user's workstation whenever GitHub Copilot CLI performs git operations in or near the malicious directory.
Successful exploitation could lead to data exfiltration, credential theft, file modification, or further system compromise.
Affected Versions
- GitHub Copilot CLI versions prior to 1.0.42
Remediation and Mitigation
Fix
The fix sets safe.bareRepository=explicit via git's GIT_CONFIG_COUNT / GIT_CONFIG_KEY_* / GIT_CONFIG_VALUE_* environment variable mechanism, which has the highest precedence over all config file sources. This prevents git from automatically discovering and using bare repositories during directory traversal — only explicitly allowlisted bare repositories will be used.
User Actions
- Upgrade GitHub Copilot CLI to 1.0.43 or later.
- Exercise caution when working in repositories that contain nested bare git repositories.
- Review project directories for unexpected bare repositories, especially in
vendor/,third_party/, or deeply nested subdirectories.
NVD (es)
GitHub Copilot CLI trae asistencia de codificación impulsada por IA directamente a tu línea de comandos. Antes de la versión 1.0.43, se ha identificado una vulnerabilidad de seguridad en GitHub Copilot CLI donde un repositorio git ’bare’ malicioso anidado dentro de un directorio de proyecto puede lograr ejecución de código arbitrario cuando el agente realiza operaciones git. Al explotar el descubrimiento automático de repositorios ’bare’ de git durante el salto de directorio, un atacante puede establecer core.fsmonitor u otras claves de configuración ejecutables para ejecutar comandos arbitrarios sin el conocimiento o la aprobación del usuario. La vulnerabilidad surge porque la clave de configuración core.fsmonitor de git (y más de 15 claves similares como core.hookspath, diff.external, merge.tool, etc.) puede especificar comandos de shell arbitrarios que git ejecutará como parte de operaciones normales como status, diff o rev-parse. Esta vulnerabilidad está corregida en la versión 1.0.43.
References
| https://github.com/github/copilot-cli/security/advisories/GHSA-9ccr-r5hg-74gf | exploit, mitigation, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-45033 | advisory | |
| https://github.com/github/copilot-cli | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-45033 changed 2026-05-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9ccr-r5hg-74gf changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-45033 changed 2026-10-26 | Public domain |