Git Arbitrary File Write
- شناسه CVE: CVE-2025-48384
- شدت: بالا
- امتیاز CVSS: 8.1
- فروشنده/سازنده: Git
File WriteGitCloneSupply Chain
A critical vulnerability in Git allows arbitrary file write during the clone operation when a victim clones a maliciously crafted repository.
## Vulnerability Overview
The vulnerability exploits a symlink/path traversal flaw in Git's checkout process. When cloning a specially crafted repository, Git follows symbolic links during the checkout phase, allowing files to be written to arbitrary locations outside the repository directory. This can lead to code execution via overwriting shell profiles, SSH configurations, or Git hooks.
## Technical Details
- **Type:** Symlink Following / Path Traversal (CWE-59)
- **Root Cause:** During the checkout operation, Git processes tree entries in a specific order. By crafting a repository with a carefully ordered combination of symlinks and regular files, an attacker can trick Git into following a symlink and writing a file outside the repository root.
- **Platforms Affected:** Particularly dangerous on Windows due to case-insensitive filesystems, but also affects Linux and macOS.
## Supply Chain Risk
This vulnerability poses a significant supply chain risk:
- A compromised or typo-squatted repository could exploit this vulnerability when cloned by developers.
- CI/CD pipelines that clone untrusted repositories are also at risk.
- Git hooks written to the .git/hooks directory can achieve immediate code execution.
## Affected Versions
- Git for Windows < 2.47.1
- Git (all platforms) < 2.43.6, 2.44.3, 2.45.3, 2.46.2, 2.47.1
## Vulnerability Overview
The vulnerability exploits a symlink/path traversal flaw in Git's checkout process. When cloning a specially crafted repository, Git follows symbolic links during the checkout phase, allowing files to be written to arbitrary locations outside the repository directory. This can lead to code execution via overwriting shell profiles, SSH configurations, or Git hooks.
## Technical Details
- **Type:** Symlink Following / Path Traversal (CWE-59)
- **Root Cause:** During the checkout operation, Git processes tree entries in a specific order. By crafting a repository with a carefully ordered combination of symlinks and regular files, an attacker can trick Git into following a symlink and writing a file outside the repository root.
- **Platforms Affected:** Particularly dangerous on Windows due to case-insensitive filesystems, but also affects Linux and macOS.
## Supply Chain Risk
This vulnerability poses a significant supply chain risk:
- A compromised or typo-squatted repository could exploit this vulnerability when cloned by developers.
- CI/CD pipelines that clone untrusted repositories are also at risk.
- Git hooks written to the .git/hooks directory can achieve immediate code execution.
## Affected Versions
- Git for Windows < 2.47.1
- Git (all platforms) < 2.43.6, 2.44.3, 2.45.3, 2.46.2, 2.47.1
نرمافزارهای تحت تأثیر
- Git < 2.47.1
- Git for Windows