Back to all posts
Tutorial
9 min read

Git CVE-2026-111760: Check and Patch Git

DevToolLab Team

DevToolLab Team

November 28, 2026

Git CVE-2026-111760: Check and Patch Git

To fix CVE-2026-111760, upgrade Git to 2.56.1, or to the fixed release of your maintenance series (2.55.1, 2.54.1, 2.53.1, 2.52.1, 2.51.3 or 2.50.2), and then update every app that bundles its own copy. The bug lets an attacker-controlled repository run code on your machine when you clone it with git clone --recurse-submodules. The Git project shipped the fixes on November 10, 2026, together with five other security fixes.

Most machines carry more than one Git. A Mac often has Apple's copy in /usr/bin and a Homebrew copy in front of it, Windows developers get one from Git for Windows and another inside GitHub Desktop, and CI runners pull whatever their base image ships. On the Mac this post was tested on, git --version reported Homebrew's 2.51.0 and /usr/bin/git reported 2.39.5: both vulnerable. As of November 28, 2026, Ubuntu and Debian have not shipped a fixed package, and Red Hat lists RHEL 6 through 10 as affected with no fix, so on those systems "just run apt upgrade" does nothing yet.

The GitHub Blog post "Git security vulnerabilities announced" by Elijah Newren, saying Git is releasing updates for six vulnerabilities affecting clones, reference handling, merges, binary patches and imports
The GitHub Blog post "Git security vulnerabilities announced" by Elijah Newren, saying Git is releasing updates for six vulnerabilities affecting clones, reference handling, merges, binary patches and imports

What CVE-2026-111760 Does During a Clone

The bug is an integer truncation in Git's index. According to the oss-security announcement from Git for Windows maintainer Johannes Schindelin, a cache entry's name length is stored in a 32-bit ce_namelen field but computed as a size_t. A crafted tree can hold a path shaped like .gitz/z...z/z with 2^32 bytes after the .git, so the stored length wraps around to 4.

Git's path-safety check walks the whole name, sees .gitz/z...z/z, and finds nothing wrong with it. Checkout then writes the path using the truncated length, which means the first 4 bytes: .git. If that entry is a symlink, Git tries to replace .git with a link to a directory the attacker controls, full of hooks or config that run code.

During a normal clone, Git refuses to replace a .git directory with a symlink. A freshly cloned submodule is different: its .git is a small gitfile, not a directory, so the symlink gets written. That is why the trigger is --recurse-submodules. The GitHub Blog post by Elijah Newren adds a second path for plain clones: the attacker can replace the top-level .git with a pointer to their own metadata, the clone ends with an error that suggests running git status, and following that advice runs their code.

The crafted repository fails Git's LARGE_PATHNAME and TREE_NOT_SORTED fsck checks, so it cannot easily be pushed to GitHub or GitLab. That does not protect you. A clean-looking repository on GitHub can list the malicious one in its .gitmodules, and --recurse-submodules will fetch it from the attacker's server.

GitHub's advisory GHSA-vp2w-7xxj-jvxr scores it CVSS 8.0 (High). CISA's assessment in the NVD record says exploitation is "none", and the bug is not in the Known Exploited Vulnerabilities catalog as of its November 27, 2026 release. Robert Chen reported it.

Which Git Versions Are Fixed

Every Git release back to v2.27.0 is affected, and versions older than 2.50 get no maintenance release at all. If you are on 2.49 or older, there is no 2.49.x fix to wait for: move to a supported series.

SeriesFixed releaseNotes
2.562.56.1Current release, recommended
2.552.55.1Backport
2.542.54.1Backport
2.532.53.1Backport
2.522.52.1Backport, shipped in Alpine 3.23
2.512.51.3Backport
2.502.50.2Oldest serviced series
2.49 and oldernoneUpgrade to a serviced series

The same releases fix five more bugs. CVE-2026-113408 lets a malicious server plant a path-traversal HEAD when you clone an empty repository over protocol v2. CVE-2026-105437 is a heap overflow in three-way merges; the announcement says that on GitLab it could be escalated to code execution through the Git process Gitaly spawns for mergeability checks. CVE-2026-114467 (more than two GPG signatures in a tag), CVE-2026-114469 (binary patches that inflate past the 1 GiB limit) and CVE-2026-114466 (fast-import reading arbitrary files) round out the set. One upgrade covers all six.

Check Every Git on the Machine

Start by listing every git on your PATH, not just the first one:

Bash
which -a git
for g in $(which -a git); do printf '%s: ' "$g"; "$g" --version; done

On our test Mac (macOS 26.6.2) that printed:

text
/usr/local/bin/git: git version 2.51.0
/usr/bin/git: git version 2.39.5 (Apple Git-154)

Upstream version numbers are easy to compare by eye, but the four-part Windows strings and Apple's suffix make it fiddly across a fleet. This short script checks a version against the fixed releases. It takes a version as an argument, or reads git --version when you pass nothing:

Bash
#!/bin/sh
# Flags a Git version older than the November 10, 2026 security releases.
v=${1:-$(git --version | awk '{print $3}')}
base=${v%%.windows.*}
min=$(echo "$base" | cut -d. -f2)
pat=$(echo "$base" | cut -d. -f3)
case "$min" in
  50) need=2 ;;
  51) need=3 ;;
  52|53|54|55|56) need=1 ;;
  *) if [ "$min" -gt 56 ]; then need=0; else need=x; fi ;;
esac
if [ "$need" = x ]; then
  echo "git $v: VULNERABLE (2.$min is not serviced; install 2.56.1)"
elif [ "${pat:-0}" -ge "$need" ]; then
  echo "git $v: patched"
else
  echo "git $v: VULNERABLE (need 2.$min.$need or later)"
fi

Run against a spread of versions, it prints:

text
git 2.39.5: VULNERABLE (2.39 is not serviced; install 2.56.1)
git 2.51.0: VULNERABLE (need 2.51.3 or later)
git 2.52.1: patched
git 2.56.0: VULNERABLE (need 2.56.1 or later)
git 2.56.1.windows.1: patched

One limit: Linux distributions backport fixes without changing the upstream number, so a patched Ubuntu package will still say 2.43.0. For distro builds, check the package version against the distro's tracker, covered below.

Then look for Git that is not on your PATH. GitHub Desktop ships its own copy, and so do many Docker images. docker run --rm <image> git --version is the quickest check for an image you build on.

Patch macOS: Homebrew Has 2.56.1, Apple Does Not

Homebrew's git formula is at 2.56.1. Check before you upgrade:

brew outdated --verbose git
brew upgrade git

The first command printed git (2.51.0) < 2.56.1 on our test Mac. After the upgrade, open a new shell and confirm which git points at Homebrew (/opt/homebrew/bin/git on Apple silicon, /usr/local/bin/git on Intel).

Apple's own Git, in /usr/bin, comes with the Xcode Command Line Tools. Apple's security releases page lists no Xcode or Command Line Tools update after Xcode 27.2 on October 29, 2026, so there is no Apple fix yet. Keep Homebrew's Git first on your PATH and avoid recursive clones with /usr/bin/git untill Apple ships one.

Patch Windows: Git for Windows and GitHub Desktop

Git for Windows 2.56.1.windows.1 shipped on November 10, 2026 with all six fixes. If you installed it with the official installer, this updates it in place (we have no Windows machine, so this command is untested here):

git update-git-for-windows

GitHub Desktop bundles its own Git. Version 3.6.11, released November 11, 2026, updated that copy to 2.56.1 according to the app's changelog. Check the version on its About screen and update if it shows anything older.

Patch Ubuntu With the git-core PPA

Ubuntu's CVE page lists every release from 16.04 to 26.10 as "Needs evaluation" as of November 28, 2026. Ubuntu 24.04 ships Git 2.43.0, which is not a serviced series, so the stock package will stay vulnerable until Canonical backports the fix.

The Ubuntu Git Maintainers team's git-core PPA published 2.56.1 for 22.04, 24.04, 26.04 and 26.10 on November 11, 2026. On a fresh Ubuntu 24.04 container:

Bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt update && sudo apt install -y git
git --version

UBUNTU_OUTPUT_PLACEHOLDER

A PPA is a third-party archive with its own signing key. It is the source GitHub's Ubuntu runner images install Git from, but add it on purpose, not as a reflex, and remove it later if you would rather go back to Canonical's package once the fix lands there.

Debian, RHEL and Alpine: Where Fixes Stand

Here is where the main Linux distributions stood when we checked their trackers on November 28, 2026:

DistributionGit packageCVE-2026-111760 status
Debian 12 bookworm1:2.39.5-0+deb12u3Vulnerable, no fix yet (bug 1153670)
Debian 13 trixie1:2.47.3-0+deb13u1Vulnerable, no fix yet
Debian sid1:2.55.0-1Vulnerable, no fix yet
RHEL 6 to 10gitAffected, rated Important, mitigation only
Alpine edge2.56.1-r0Fixed, built November 10, 2026
Alpine 3.232.52.1-r0Fixed, built November 10, 2026
Alpine 3.222.49.1-r0No fix listed in Alpine's security database
Ubuntu 16.04 to 26.10variousNeeds evaluation, use the PPA above

On Debian and RHEL there is no supported package to install yet. Your options are to wait, to build Git 2.56.1 from source into /usr/local, or to use the mitigation below on any machine that clones code you did not write. Red Hat's statement says it rates the bug Important rather than Critical becuase exploitation needs a recursive clone of an untrusted source. For Alpine images, FROM alpine:3.23 and a rebuild picks up the fix; a 3.22 base does not.

CI Runners and Tools That Clone for You

GitHub-hosted runners are already patched. The current runner image readmes list Git 2.56.1 on ubuntu-24.04 (image 20261122.23.1) and macos-15 arm64 (20261123.0558.1), and Git 2.56.1.windows.1 on windows-2025 (20261124.341.2). Self-hosted runners use whatever Git their machine has, so patch them like any other host. GitHub Enterprise Server admins need 3.19.16, 3.20.12, 3.21.10 or 3.22.5, which carry backported fixes under different Git version numbers.

The harder part is the clones nobody types. Several common tools clone submodules on your behalf:

  • npm fetches git dependencies through @npmcli/git, whose clone code passes --recurse-submodules to git clone.
  • pip runs git submodule update --init --recursive after it clones a git+https:// requirement.
  • Terraform module sources with a git:: prefix go through HashiCorp's go-getter, which runs the same submodule update --init --recursive.
  • actions/checkout with submodules: recursive does it in CI.

The advisories name --recurse-submodules; pip and go-getter run the equivalent submodule step as a separate command, so treat all four as exposed until the Git underneath them is patched. Each of them uses the system git, so patching that one binary covers them.

If You Cannot Patch Today

Clone without submodules, read where they point, and only then fetch them. This is the order Red Hat's mitigation recommends. Here it is on the Zydis disassembler, which pulls in one submodule:

Bash
git clone https://github.com/zyantific/zydis.git
cd zydis
git config --file .gitmodules --get-regexp 'submodule\..*\.url'
text
submodule.dependencies/zycore.url https://github.com/zyantific/zycore-c

If every URL points to a host you trust, run git submodule update --init --recursive. If one points at an unknown server, stop there. Red Hat also suggests cloning untrusted code inside an unprivileged container, which limits what a malicious hook can reach even when everything else fails.

Avoid one false fix: setting core.hooksPath in your global config does not help. The attack points Git at the attacker's own repository config, and repository-level config overrides global config.

Common Errors and Warning Signs

A clone that fails and tells you to run git status. That is the plain-clone variant GitHub describes. Do not follow the advice inside that directory; delete it and re-clone with a patched Git.

git --version still shows the old version after an upgrade. Your shell found another Git first. Run which -a git again and fix the PATH order, or open a new terminal.

Debian or Ubuntu says Git is already the newest version. That is true of the archive, not of the fix. Check the distro tracker, not apt.

When Not to Rely on This

This post covers the Git command-line client. Libraries that reimplement Git, such as libgit2, JGit and gitoxide, have their own code and their own advisories; check each project rather than assuming this fix applies. Our version-check script reads upstream numbers only, so it cannot tell a backported distro package from an unpatched one. And mitigation is not a patch: it depends on every person and every pipeline remembering not to recurse.

Conclusion

Run which -a git on every machine you develop on and every runner you own, and upgrade each copy to 2.56.1 or its series' fixed release. On a Mac that means Homebrew's Git, since Apple has not shipped a fix. On Ubuntu, the git-core PPA has 2.56.1 today. On Debian and RHEL, there is no fixed package yet, so clone without --recurse-submodules and inspect .gitmodules until there is. GitHub-hosted runners are already done; self-hosted runners and Docker base images are the ones people forget.

  • Git Command Generator - build the non-recursive clone and submodule commands from this guide without remembering every flag.
  • Semver Range Tester - check whether a pinned Git or tool version falls inside a patched range before you roll it out.
  • GitHub Actions Generator - write a workflow that checks out submodules only when you ask for them.
  • SHA-256 File Checksum - verify a Git installer or source tarball against its published checksum before you install it.

Related Posts

Java4Shell: How to Check and Patch Java

Java4Shell (CVE-2026-114938) is fixed in OpenJDK 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Check every JVM, patch, restart and mitigate with a JVM flag.

By DevToolLab Team•

Nginx HTTP/2 RCE: How to Check and Patch

CVE-2026-123007 and CVE-2026-123633 let attackers run code on Nginx with HTTP/2. Fixed in 1.31.9 and 1.30.7. Check the real version, patch or turn HTTP/2 off.

By DevToolLab Team•

How to Flush DNS on Mac, Windows, Linux

Run ipconfig /flushdns on Windows, dscacheutil and killall -HUP mDNSResponder on macOS, resolvectl flush-caches on Linux, and learn which cache you can't clear.

By DevToolLab Team•