Security Digest · Jul 8, 2025 · Vulnerability · Other
Git CVE-2025-48384: Recursive Clone Runs Attacker Hooks
A trailing carriage return in a submodule path lets a malicious repo run code on recursive clone on macOS/Linux. Fixed in Git 2.50.1 and backports. In KEV.
Our verdict
Check exposure
Most developer machines picked up the fix in 2025, but stale Git in CI images, build servers and unmanaged Macs is still exposed to a lure-based attack that has been used in the wild; check versions and stop recursive clones of untrusted repos.
Who must act: Teams with macOS or Linux developer machines, CI runners or container images carrying Git older than the fixed releases, and anyone who clones third-party repositories with --recursive or via tools that do so by default.
Who can relax: Windows users of Git for Windows, which the discoverer says is not directly vulnerable, and hosts already on Git 2.50.1 or later or a fixed distribution package.
- Affected
- Git before 2.43.7
Git 2.44.x before 2.44.4, 2.45.x before 2.45.4, 2.46.x before 2.46.4
Git 2.47.x before 2.47.3, 2.48.x before 2.48.2, 2.49.x before 2.49.1, 2.50.0
GitHub Desktop before 3.5.1 on macOS
Apple Git in Xcode before Xcode 26 - Fixed in
- Git 2.43.7, 2.44.4, 2.45.4, 2.46.4, 2.47.3, 2.48.2, 2.49.1, 2.50.1 and later releases
Ubuntu USN-7626-1 (for example 24.04: 1:2.43.0-1ubuntu7.3; 22.04: 1:2.34.1-1ubuntu1.13)
GitHub Desktop 3.5.1 (embedded Git 2.47.3)
Xcode 26 (Apple Git) - CVSS
- 8.0 (v3.1, CNA)
- EPSS
- 4.4% (percentile 91)
- CISA KEV
- Yes, listed as known exploited
- Exploitation
- Exploited in the wild
- Severity
- High
What to do
- Run git --version (and which -a git on macOS) on developer machines, CI runners and build images; on distro packages, check the package version instead (dpkg -l git or rpm -q git).
- Upgrade to Git 2.50.1 or a later release, a fixed maintenance release, or your distribution's patched package.
- On macOS, update Xcode or the Command Line Tools to 26 or later and GitHub Desktop to 3.5.1 or later; make sure the git first in PATH is a fixed one.
- Rebuild CI runner and container images that bundle Git rather than relying on host updates.
- Do not clone untrusted repositories with --recursive or --recurse-submodules; clone, inspect .gitmodules, then run git submodule update --init.
How to check if you are affected or compromised
- Look for executable hooks without a .sample suffix under .git/modules/*/hooks/ in recently cloned repositories.
- Search working copies for files or directories whose names contain a carriage return, which CrowdStrike uses as an exploitation signal.
- Check EDR telemetry for git writing a post-checkout hook and then a shell or Python process running from a hooks directory, and for post-checkout scripts referencing hooks/vm.tf or hooks/mongodb.hook.js.
- Review which third-party repositories developers cloned recursively, especially ones received through job offers, chat or email.
What happened#
On July 8, 2025, the Git project released 2.50.1 and seven maintenance releases fixing CVE-2025-48384 (GHSA-vwqx-4fm8-6qc9, CVSS 3.1 8.0 per GitHub's advisory). When Git reads a config value it strips a trailing carriage return (CR), but when it writes one ending in CR it does not quote it, so the CR is lost on the next read. A malicious repository can give a submodule a path ending in CR. During a recursive clone, Git validates one path but checks the submodule out to another. If the repo also holds a symlink from that altered path into the submodule's hooks directory, an attacker-supplied post-checkout hook runs on the victim's machine.
David Leadbeater, credited with the fix, explained it on July 9. It needs a platform that allows control characters in file names, so macOS and Linux are exposed and Windows "is not directly vulnerable". Datadog validated public proofs of concept within days. CISA added the CVE to the KEV catalog on August 25, 2025, though SecurityWeek found no public reports of the attacks at the time. In October 2025 CrowdStrike reported active exploitation that paired social engineering with malicious repositories. A post-checkout hook used Python to run a first stage named hooks/vm.tf, unpacked a TAR into /tmp, and then deleted the submodule files. No actor has been named.
Who is affected#
Affected: Git before 2.43.7, and each later line before 2.44.4, 2.45.4, 2.46.4, 2.47.3, 2.48.2, 2.49.1 or 2.50.1. Later releases include the fix. Distributions backported it without changing the base version. Ubuntu 24.04's fixed package is 1:2.43.0-1ubuntu7.3 (USN-7626-1), so git --version alone can mislead. GitHub Desktop 3.5.1 moved its embedded Git to 2.47.3; it clones recursively by default. Apple fixed its bundled Git in Xcode 26 on September 15, 2025.
Do you really need to act?#
The attack needs a victim to clone a hostile repository recursively. That is a lure, not a worm, but a cheap one: developers clone strangers' repositories all the time. Patched laptops are fine. The leftovers are older CI and container images, long-lived build servers, and Macs that run Apple's Git without Xcode updates. On a CI runner the hook runs with the runner's secrets in reach.
What to do now#
- Check versions everywhere:
git --version, pluswhich -a giton macOS. For distro packages, usedpkg -l gitorrpm -q gitand compare with your vendor's advisory. - Upgrade to Git 2.50.1 or later, a fixed maintenance release, or the patched distro package.
- On macOS, update Xcode or the Command Line Tools to 26 or later, and GitHub Desktop to 3.5.1 or later.
- Rebuild CI runner and container images that bundle Git.
- Never clone untrusted repositories with
--recursive, as GitHub's announcement advises. Clone, read.gitmodules, then rungit submodule update --init.
How to tell if you were hit#
List non-sample hooks in submodule metadata with find ~/src -path '*/.git/modules/*/hooks/*' -type f ! -name '*.sample'. Find names containing a carriage return with find ~/src -name "*$(printf '\r')*". In EDR, look for git writing a post-checkout hook followed by a shell or Python child running from a hooks directory. CrowdStrike also flags hook scripts referencing hooks/vm.tf or hooks/mongodb.hook.js. If a developer ran a recursive clone from a recruiter or stranger, treat the machine as compromised and rotate its SSH keys, tokens and cloud credentials.
Timeline#
- — Git 2.50.1 and maintenance releases ship; GitHub Desktop 3.5.1 updates its embedded Git.
- — David Leadbeater publishes technical details; Datadog follows on July 10 and confirms public proofs of concept work.
- — CISA adds CVE-2025-48384 to KEV (due September 15, 2025).
- — Apple fixes its bundled Git in Xcode 26.
- — CrowdStrike reports active exploitation via social engineering.
Vulnerability records
- CVE-2025-48384 · KEV 2025-08-25 · Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to…
Sources
Original sources first: vendor and project advisories, CVE and government records, the discoverers’ write-ups. Every claim above links to one of these. See how the Security Desk works.
Original and primary sources
- Git / GitHub — GHSA-vwqx-4fm8-6qc9: Arbitrary code execution through broken config quoting github.com
- CVE record — CVE-2025-48384 cve.org
- NVD — CVE-2025-48384 nvd.nist.gov
- CISA — Known Exploited Vulnerabilities: CVE-2025-48384 cisa.gov
- David Leadbeater (dgl.cx) — CVE-2025-48384 write-up dgl.cx
- GitHub Blog — Git security vulnerabilities announced (July 2025) github.blog
- GitHub Desktop — Release 3.5.1 github.com
- Apple — About the security content of Xcode 26 support.apple.com
- Ubuntu — CVE-2025-48384 ubuntu.com
- Datadog Security Labs — Git CLI arbitrary file write (CVE-2025-48384) securitylabs.datadoghq.com
- CrowdStrike — Falcon defends against Git vulnerability CVE-2025-48384 crowdstrike.com
Coverage and analysis
- SecurityWeek — Organizations warned of exploited Git vulnerability securityweek.com