Git closes clone-time code execution hole in malicious repositories
Git 2.56.1 and backports fix CVE-2026-111760, where a crafted repository can run code on a machine that clones it recursively. Five further flaws were patched in the same release.
What happened
The Git project published version 2.56.1 this week, along with maintenance releases for the older lines: 2.50.2, 2.51.3, 2.52.1, 2.53.1, 2.54.1 and 2.55.1. The headline fix is CVE-2026-111760, a bug that allows a booby-trapped repository to execute the author’s code on a machine that pulls it down together with its submodules, as The Hacker News reports.
The root cause is an integer truncation in the handling of Git’s index. A path of extreme length clears the safety check, but the shortened name Git then uses on disk can be steered toward .git. Inside a submodule that has just been cloned, .git is a plain file rather than a directory, and Git’s refusal to replace a .git directory with a symbolic link does not apply. An attacker can therefore point that file at a location of their choosing, one that holds hooks or configuration. Hooks are programs Git invokes at defined points in its workflow, which is where code execution enters the picture. The corrected releases reject over-long paths before any truncation happens.
The same batch of releases addresses five additional issues:
- CVE-2026-113408: cloning an empty repository over protocol v2 from a hostile server can deliver a branch name containing path traversal, and a later update to that branch can write outside Git’s reference directory with the files backend.
- CVE-2026-114467: a tag carrying more than two GPG signatures corrupts stack memory during a merge and can cause a denial of service. Hosting services that perform such merges on behalf of users may be exposed too.
- CVE-2026-114469: a binary patch that expands beyond roughly 1 GiB slips past the patch size limit and crashes Git through an out-of-bounds read.
- CVE-2026-105437: a large merge with many conflicts plus a big conflict-marker-size attribute writes past a buffer boundary and corrupts heap memory.
- CVE-2026-114466: three fast-import features (rewrite-submodules-from, rewrite-submodules-to and export-pack-edges) could read arbitrary files or create and append to them. Git now rejects these unless –allow-unsafe-features is set.
Who is affected
Anyone who clones repositories they do not fully control, particularly with recursive submodule checkout, plus the CI runners and hosting platforms that do this automatically. GitHub has already patched github.com and GitHub Enterprise Cloud; Enterprise Server customers need 3.19.15, 3.20.11, 3.21.9 or 3.22.4. Fixed builds of GitHub Desktop and the GitHub Copilot app are still in preparation, and Codespaces and Actions will receive the patched Git. Git for Windows had not shipped a build based on 2.56.1 as of the source’s check on Tuesday at 19:09 UTC.
What it means
Developer workstations and build agents are attractive targets because they usually hold credentials, tokens and deploy keys. A single recursive clone of the wrong repository can be enough. The merge flaw deserves separate attention from anyone running a code-hosting service: GitLab, which assigned CVE-2026-105437, notes that servers are the likely target via git merge-tree, a command commonly run to test whether a merge request applies cleanly. Since conflict-marker-size can be defined in a .gitattributes file committed to the repository, any user who can push a branch and open a merge request may be able to reach it.
What to do now
- Install a fixed Git from your operating system or Git distributor, and update tools and container images that bundle their own copy.
- Enterprise Server admins should move to one of the versions listed above.
- If patching has to wait, GitHub’s interim measures are to clone only from servers you trust, avoid recursive clones of unfamiliar repositories, skip merging content or tags from unknown sources, and refrain from processing binary patches or fast-import streams you did not originate. These reduce exposure but do not replace the update.
- For CVE-2026-105437, operators who cannot upgrade yet can set conflict-marker-size=7 in each repository’s info/attributes file, or switch off those merge checks for untrusted repositories.
Reviewing where automated clones and merge checks pull from is a good starting point; our team is happy to help with the assessment via the security page.
This post was summarised and put in context with AI assistance from the source named above. The original source is authoritative.