1. When 'git clone' Becomes a Weapon
For software engineers and DevOps teams, running git clone <repo> is a daily, reflexive action presumed to be safe. In 2022 and 2024, critical vulnerabilities in the core Git client demonstrated that cloning an untrusted Git repository could execute arbitrary malicious code on developer laptops and automated CI/CD runners before any build scripts were ever triggered: CVE-2022-24765 and CVE-2024-32002 (CVSS 9.0).
2. Git Client CVE Comparison Matrix
| CVE ID | CVSS | Target Platform | Exploit Mechanism |
|---|---|---|---|
| CVE-2024-32002 | 9.0 | Git on case-insensitive filesystems (macOS / Windows) | Submodule symlink collision overwriting .git/hooks/post-checkout |
| CVE-2022-24765 | 7.8 | Git CLI on multi-user systems (Windows / Linux) | Parent directory search finding untrusted .git/config |
3. Technical Root Cause: CVE-2024-32002 Submodule Hook Overwrite
Git submodules are embedded Git repositories stored in .git/modules/<name>/. Git hooks (like post-checkout) reside in .git/hooks/ and execute automatically during clone operations.
On case-insensitive filesystems (APFS on macOS, NTFS on Windows), the filesystem treats .GIT and .git as identical directory paths. An attacker crafted a repository containing:
- A symbolic link named
A/modules/xpointing to../../.git/modules/x. - A submodule configured with a path named
a/modules/xcontaining a malicioushooks/post-checkoutscript.
When Git cloned the repository recursively with git clone --recursive, it followed the symlink and wrote the submodule's hook files directly into the top-level repository's .git/hooks/post-checkout path, executing the script immediately upon checkout without user interaction.
4. Remediation & Developer Workstation Hardening
# Upgrade Git CLI to 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, or 2.40.2+
git --version
# Disable automated symbolic link resolution during submodule cloning if unpatched
git config --global core.symlinks false
Suggested & Related Reading
Explore related engineering guides from Kenneth D'Silva:
-
Container Escapes & Kubernetes Vulnerabilities: CVE-2024-21626 & CVE-2023-5043
A technical exploration of modern container escapes and Kubernetes ingress vulnerabilities, ...
-
Juniper Junos OS J-Web RCE Chain (CVE-2023-36844 to 36847): PHP Environment Injection
A technical post-mortem of Juniper Junos OS J-Web vulnerability chains (CVE-2023-36844, 3684...
-
Laravel Ignition RCE (CVE-2021-3129): Exploiting PHP Debug Pages in Production
A technical examination of Laravel Ignition remote code execution (CVE-2021-3129), PHP Phar ...
-
OpenSSL CVE-2022-3602 & CVE-2022-3786: The Vulnerability That Wasn't Heartbleed 2.0
Technical post-mortem on OpenSSL CVE-2022-3602 and CVE-2022-3786, X.509 email address punyco...