A newly disclosed and severe security flaw in Git could allow malicious actors to execute arbitrary code on a victim’s machine simply by tricking them into cloning a specially crafted repository recursively. The Git project moved swiftly to address the issue this week, releasing Git version 2.56.1 alongside a comprehensive wave of security patches covering older version series to protect the global developer ecosystem.
The vulnerability, which has been officially tracked and cataloged under the identifier CVE-2026-111760, stems from a subtle integer truncation flaw residing deep within the way Git manages and processes its internal repository index. Under normal operating conditions, Git implements a series of rigorous safety checks designed to validate file paths and prevent unauthorized overwriting of critical configuration files. However, this specific vulnerability exploits a loophole involving extremely long path names. An attacker can construct a path that successfully slips past Git’s initial safety verification routines, but due to the integer truncation defect, Git subsequently writes the path to disk under a much shorter name. By manipulating this behavior, an attacker can designate the shortened name to map directly onto the sensitive .git directory structure.
This manipulation opens the door for a sophisticated form of directory tampering. Specifically, the flaw enables an attacker to replace a submodule’s legitimate .git file with a symbolic link pointing directly to an external folder controlled by the attacker, which can be pre-populated with malicious hooks or custom configurations. Within the Git architecture, hooks are automated scripts and programs that Git is designed to execute automatically at predetermined phases of operation, such as after a checkout or commit. Once an unsuspecting developer clones the recursive repository and Git interacts with the compromised directory structure, the malicious hooks are triggered, giving the attacker’s embedded code full execution rights on the local system.

The mechanics of submodules play a critical role in the viability of this attack vector. Under standard conditions, Git firmly protects its core infrastructure by refusing to overwrite an existing .git directory with a symbolic link. However, the dynamics shift during the initialization of a freshly cloned submodule, where .git is provisioned as a file rather than a directory. Attackers leverage this specific operational state to bypass standard directory protection mechanisms, chaining the integer truncation bug with submodule cloning behaviors to achieve silent and automated code execution.
Recognizing the gravity of the threat, the Git project published an immediate security advisory and release announcement detailing the rollout of patched versions. The newly minted releases, which include Git 2.56.1 as well as backported fixes for the 2.50 through 2.55 version series designated as versions 2.50.2, 2.51.3, 2.52.1, 2.53.1, 2.54.1, and 2.55.1, introduce strict boundary checks. These updated versions explicitly refuse to process extremely long paths before their lengths can be improperly truncated by the vulnerable index handling routines, thereby neutralizing the attack vector at its source.
Major software platforms and code-hosting providers that bundle or distribute Git have mobilized rapidly to integrate these vital patches into their respective ecosystems. GitHub, which heavily relies on Git and embeds the tool across multiple proprietary applications and services, published a detailed technical write-up outlining its mitigation timeline and deployment strategy. The company strongly advised all developers and organizations to promptly install the updated Git packages provided directly by their respective operating system vendors or trusted software distributors, as well as to update any standalone desktop applications or utility tools that ship with an internal, bundled copy of Git.
GitHub confirmed that it had already successfully deployed the necessary security updates to its primary infrastructure on github.com as well as the GitHub Enterprise Cloud environment. For organizations utilizing on

-premises deployments via GitHub Enterprise Server, the fixes have been bundled into versions 3.19.15, 3.20.11, 3.21.9, and 3.22.4. Furthermore, engineering teams at GitHub are actively preparing updated builds of GitHub Desktop and the GitHub Copilot companion applications, while fully integrating the patched versions of Git into cloud-based developer environments such as GitHub Codespaces and GitHub Actions pipelines.
Meanwhile, other prominent ecosystems have reported concurrent vulnerabilities addressed within the same broader release cycle. GitLab highlighted a distinct vulnerability assigned the identifier CVE-2026-105437, noting that code-hosting servers are primarily exposed and vulnerable when executing the git merge-tree command. Automated servers frequently invoke this specific command in the background to evaluate whether an incoming pull request or merge request can be cleanly merged into a target branch without introducing code conflicts.
According to technical assessments, the vulnerability can be weaponized by manipulating the conflict-marker-size attribute, which can be configured inside a .gitattributes file and committed directly to a software repository. If a remote code-hosting server automatically reads and processes repository attributes during server-side merge evaluations, any user with permission to push branches and open a pull or merge request can effectively trigger the underlying flaw.
For server administrators and hosting providers unable to execute an immediate upgrade to the latest patched Git releases, temporary mitigations have been proposed. Administrators can manually append conflict-marker-size=7 to the info/attributes file of each individual repository or completely disable automated merge checks when dealing with untrusted repositories and external contributions. As the broader software development industry works to roll out the updated Git binaries, developers are encouraged to audit their local environments and update their toolchains to protect against potential exploitation of these deeply ingrained parser and index-handling vulnerabilities.
