CVE-2026-111760: Git recursive clone can overwrite a submodule gitfile with a symlink and run an attacker’s hooks

ByLinuxtastic

November 30, 2026 #CVE, #Git

When Git clones a repository with --recurse-submodules, each submodule’s working tree gets a .git file (a “gitfile”) pointing at where the submodule’s real repository lives. Before 2.50.2, 2.51.3, 2.52.1, 2.53.1, 2.54.1, 2.55.1 and 2.56.1, a repository hosted by an attacker could make Git overwrite that gitfile with a symbolic link to a directory the attacker controls, so that the next thing Git does in that submodule reads the attacker’s configuration and runs the attacker’s hooks on the cloning user’s machine. The fix commit explains the mechanism: a path name whose length overflowed the 32-bit field Git stored it in could be written to disk under a truncated name, and .git is a very short name. Upgrade Git to the fixed release for your line, and until then do not recursively clone repositories from hosts you do not trust; clone them plainly and read .gitmodules first. Repositories on the usual forges are not the vector, because a forge would not serve the crafted object; a server the attacker runs is.

CVE-2026-111760 at a glance.

ComponentGit, the index reader in read-cache.c (cache-entry name lengths), reached through git clone --recurse-submodules and git submodule update; packaged as git everywhere
Affected versionsevery Git before 2.50.2, and 2.51.0–2.51.2, 2.52.0, 2.53.0, 2.54.0, 2.55.0 and 2.56.0; the distribution packages in the table below (2.39, 2.47, 2.53, 2.55) are all affected
Fixed inGit 2.50.2, 2.51.3, 2.52.1, 2.53.1, 2.54.1, 2.55.1 and 2.56.1 (the record), by commit 29411cf5 “read-cache: reject cache entries with over-long names”, which refuses a name length over INT_MAX and adds an index.maxPathLen setting (default 1073740799 bytes). The GitHub advisory GHSA-vp2w-7xxj-jvxr and the GitLab-hosted release notes both refused our reader, so the release date is not on this page
SeverityGitHub (CNA) CVSS 3.1 8.0 High (AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H), CWE-59 (link resolution before file access); NVD Received with the CNA’s vector, CISA SSVC exploitation none / not automatable / total. Red Hat Important, 8.8 (AV:N/AC:L/PR:N/UI:R/S:U, CWE-22); SUSE important, 8.8 and CVSS 4.0 8.6; Ubuntu Medium, 8.0. The disagreement is over whether a user choosing to clone counts as privileges and complexity, not over what happens next
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 30 November 2026 (catalogue 2026.11.27). EPSS 0.0068 (47th percentile) on 29 November 2026
Who is exposedanyone, or any pipeline, that runs git clone --recurse-submodules (or --recursive, or git submodule update --init --recursive) against a repository served from a host the attacker controls. The record says it explicitly: “an attacker-controlled repository hosted by the attacker rather than on a normal forge site”. CI runners that clone arbitrary user-supplied URLs recursively, package builders that follow submodule URLs into third-party hosts, and developers who clone a demo from a stranger’s server are the realistic cases; a non-recursive clone is not on this path
PublishedCVE record 16 November 2026 (GitHub CNA); this page built 30 November 2026, last updated 30 November 2026

What it is

Git’s index stores each tracked path as a cache entry, and the entry records the length of its name in ce_namelen, a 32-bit field, while the code that computes the length works in size_t. The fix commit’s message describes what that mismatch allows: a path can be constructed whose true length does not fit the field, so the stored length is truncated, and the name Git then writes to the working tree is the first few bytes of a much longer one. A path that begins .gitz/, with enough padding behind it, can therefore be written as .git. In a freshly cloned submodule .git is a gitfile, a one-line pointer to the real repository under the superproject’s .git/modules/, and the record says the overwrite can make it “a symbolic link” instead, pointing “to a directory containing attacker-controlled Git configuration or hooks”. From then on every Git command in that submodule, including the rest of the recursive clone, reads config and runs hooks/ from the attacker’s directory, and a post-checkout hook is code execution on the cloning machine.

The fix, by Elijah Newren and Toon Claes with help from Johannes Schindelin and Jeff King and reported by Robert Chen, makes read-cache.c reject any cache-entry name longer than INT_MAX, and adds a configurable ceiling, index.maxPathLen, whose default of INT_MAX / 2 - 1024 (1073740799 bytes) is far above any real path and far below the overflow; the commit touches read-cache.c, config.c, environment.c and .h, the documentation for the new setting and a new test helper and test script. The commit message does not name the CVE; the link is NVD’s.

Two things bound the exposure. The repository has to be hosted by the attacker, because the crafted entry would not survive a normal forge, and the clone has to be recursive, because the gitfile that gets overwritten belongs to a submodule; the record says so and adds that “users should avoid cloning repositories from untrusted sources”. Red Hat rates it Important rather than Critical for exactly that reason, “a specific precondition where a user or automated pipeline initiates a recursive repository retrieval against an untrusted source”, and gives the same mitigation. The disagreement over the score is about how to count the user’s own action: GitHub’s vector charges it as privileges required and high complexity, Red Hat’s and SUSE’s do not, and all four agree on the impact.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 30 November 2026; the link in the row is the tracker page, which will be newer than this one.

DistributionStatusFixed package
AlpineTracker unreachable on 30 November 2026—
DebianVulnerable in bookworm (1:2.39.5-0+deb12u3), trixie (1:2.47.3-0+deb13u1), forky (1:2.53.0-1) and sid (1:2.55.0-1); unfixed, bug 1153670; no DSA or DLAnone on 30 November 2026
UbuntuMedium, 8.0; needs evaluation on every release from 16.04 to 26.10 (last updated 18 November)none on 30 November 2026
RHEL, Rocky, Alma, CentOS StreamImportant, 8.8, CWE-22; the per-product table and errata did not render for our reader on 30 November 2026; mitigation: avoid recursive retrieval from untrusted sourcesnot read
openSUSE/SLEimportant, 8.8 / CVSS 4.0 8.6, Analysis (bug 1289501); In progress for SLE 15 SP7 and 15 SP6-LTSS with git >= 2.51.3-150600.3.18.1 in QA; no announcement yetnone released on 30 November 2026
Fedora, Arch; Git for Windows, Homebrew, source buildsNot consulted; upstream fixed versions applyGit 2.50.2 / 2.51.3 / 2.52.1 / 2.53.1 / 2.54.1 / 2.55.1 / 2.56.1

How to check

Three questions, in order: which Git is installed, does anything on this host clone recursively, and where from. The first is one command; the second and third are your CI configuration and your build scripts, which is where the exposure lives.

# 1. version: fixed is 2.50.2, 2.51.3, 2.52.1, 2.53.1, 2.54.1, 2.55.1 or 2.56.1 and later within each line
git --version
dpkg -l git 2>/dev/null | awk '/^ii/{print $2, $3}'; rpm -q git 2>/dev/null
git config --get index.maxPathLen          # only a fixed Git knows this setting; empty on both is not a test

# 2. who clones recursively on this host: CI definitions, build scripts, developers' shell history
grep -rnE -- '--recurse-submodules|--recursive|submodule update' /etc/gitlab-runner /home/*/.gitlab-ci.yml /srv /opt 2>/dev/null | head
grep -rnE -- 'submodules:\s*(recursive|true)' . 2>/dev/null | head     # GitHub Actions checkout, GitLab GIT_SUBMODULE_STRATEGY
git config --global --get submodule.recurse; git config --system --get submodule.recurse

# 3. where the submodules point: a URL on a host you do not control is the exposure
find / -name .gitmodules -not -path '*/node_modules/*' 2>/dev/null | head -50 | xargs -r grep -H 'url ='

# after the fact: a submodule whose .git is a symlink, not a file, has been tampered with
find / -path '*/.git' -type l 2>/dev/null

A fixed version closes the question. On an affected version, exposure is the product of step 2 and step 3: recursive clones from hosts you control are safe as far as this record goes, recursive clones of whatever URL a user or a dependency file supplies are the case to fix, and a submodule.recurse=true in global or system configuration makes every git pull recursive without anyone typing the flag. The last command is a detection, not a check: a .git that is a symbolic link inside a cloned submodule is not something Git produces on its own.

How to fix it

Upgrade Git. No daemon needs restarting; the next git invocation uses the new binary. On 30 November 2026 no distribution we could read has shipped a fixed package, so on a stable release the fix is a backport, a newer Git from a trusted repository, or the mitigation below.

# Debian / Ubuntu once a DSA or USN lands; RHEL family once an erratum lands; SUSE once the QA build is released
apt update && apt install --only-upgrade git
dnf upgrade git
zypper patch
# from source (the fixed tags are v2.50.2 .. v2.56.1):
curl -LO https://www.kernel.org/pub/software/scm/git/git-2.56.1.tar.xz && tar xf git-2.56.1.tar.xz && cd git-2.56.1 && make prefix=/usr/local all && sudo make prefix=/usr/local install
git --version

Until the upgrade, the mitigation is the one both the record and Red Hat give: do not clone recursively from sources you do not trust. Clone plainly, read .gitmodules, and initialise only the submodules whose URLs you recognise; in CI, pin submodule URLs to hosts you run and refuse jobs that supply their own. What not to do: setting index.maxPathLen on an unfixed Git does nothing, because the setting does not exist there; and a sandbox around the clone limits the damage but does not stop the hook from running inside it, so treat anything cloned recursively from an untrusted host on an unfixed Git as code you have executed.

# mitigation: never recurse into submodules you have not read
git config --global submodule.recurse false
git clone https://untrusted.example/repo.git && cd repo && cat .gitmodules     # look at every url = line first
git submodule update --init -- path/you/trust                                   # one at a time, no --recursive
# GitLab CI: GIT_SUBMODULE_STRATEGY: none ; GitHub Actions: actions/checkout with submodules: false (the default)

Sources

  • CVE-2026-111760 at CVE.org — the GitHub CNA record (16 November 2026): the description, the seven affected ranges and fixed versions, CVSS 3.1 8.0, CWE-59
  • Fix commit 29411cf5 “read-cache: reject cache entries with over-long names” — the mechanism, the index.maxPathLen setting, the files changed and the credits; the GitHub advisory GHSA-vp2w-7xxj-jvxr and the 2.56.1 release notes refused our reader on 30 November 2026
  • NVD entry — Received, carrying the CNA’s vector and the CISA SSVC assessment; no NVD score or CPEs yet
  • Distribution trackers: Debian (unfixed, bug 1153670) · Ubuntu (Medium, needs evaluation) · Red Hat (Important, 8.8, the statement and mitigation) · SUSE (important, bug 1289501, 2.51.3 backport in QA) · Alpine (unreachable on 30 November)
  • CISA KEV catalogue 2026.11.27, not listed · EPSS score for this CVE, 29 November 2026

Related reading

This advisory page was assembled from the primary sources listed above on 30 November 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.