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 internals. Prior to 2.50.2, 2.51.3, 2.52.1, 2.53.1, 2.54.1, 2.55.1, and 2.56.1, an attacker-controlled repository hosted by the attacker rather than on a normal forge site can exploit git clone --recurse-submodules by causing Git to overwrite a submodule gitfile with a symbolic link. The symbolic link can point to a directory containing attacker-controlled Git configuration or hooks, allowing those hooks or configuration to execute code on the cloning user's system. The issue requires the recursive-submodule option, and users should avoid cloning repositories from untrusted sources. This issue is fixed in versions 2.50.2, 2.51.3, 2.52.1, 2.53.1, 2.54.1, 2.55.1, and 2.56.1.
Team,
The Git project released new versions on November 10th, 2026, addressing six vulnerabilities. All supported platforms are affected in one way or another, and all Git versions back to v2.27.0 are affected. Versions older than v2.50 are also affected but are no longer serviced by maintenance releases. The fixed versions are: v2.50.2, v2.51.3, v2.52.1, v2.53.1, v2.54.1, v2.55.1, and v2.56.1.
Link to the announcement:
https://lore.kernel.org/git/xmqqh5hosgw5.fsf@gitster.g/
We highly recommend to upgrade.
The addressed issues are:
CVE-2026-111760: Recursive clones can lead to remote code execution.
A cache entry's name length is stored in the 32-bit cenamelen field but computed as sizet. A crafted tree can build a path of the form .gitz/z...z/z with 2^32 bytes following the .git, so that cenamelen wraps to 4. Git's path-safety validation walks the whole NUL-terminated name and finds nothing wrong with .gitz/z...z/z. But checkout writes the path from cenamelen, i.e. only the first 4 bytes. Thus Git writes the validated path .gitz/z...z/z as .git. If the entry is a symlink, checking out the tree tries to overwrite .git with a potentially malicious symlink. While cloning, Git refuses to replace a .git directory with a symlink. But a freshly cloned submodule's .git is a gitfile rather than a directory, so the symlink is written. The target of that symlink holds the hooks or config that may then run attacker-specified code.
Trigger: an attacker-controlled repository (hosted by the attacker, not on a normal forge) cloned with git clone --recurse-submodules. As far as we know, this is currently only triggerable when --recurse-submodules is used. Such a repository fails the LARGEPATHNAME and TREENOTSORTED fsck checks and therefore cannot easily be pushed to the major forges. That does not protect downstream users, as an innocuous-looking .gitmodules pointing to the malicious repository suffices.
CVE-2026-113408: Malformed unborn HEAD advertised by a server.
In the protocol v2 ls-refs response the client copies the symref-target verbatim into .git/HEAD and passes advertised refs straight to allocref(). A server can advertise HEAD as a symref to refs/heads/../../../TARGET. When the user then runs git commit, HEAD resolves to that value. With the files ref backend, Git then writes the ref to .git/refs/heads/../../../TARGET, i.e. to TARGET in the root of the repository.
Trigger: a malicious or otherwise untrusted server plus a client clone over protocol v2. The file is written when a later operation resolves and updates the malformed ref.
CVE-2026-114467: More than two GPG signatures in a commit message.
When Git strips the GPG signatures from a commit message, it only accounts for two signatures. removesignature() stores the start/end positions of signatures in a fixed-size stack array. A commit message containing more than two signatures makes it write past the end of that array and corrupt stack memory. This makes for a denial-of-service attack that can potentially also affect forges. When such a tag is pushed to a remote and a merge action is initiated there, the forge runs the same code.
Trigger: a tag object whose message carries more than two (e.g. PGP) signatures, merged with git merge. That runs removesignature() and corrupts the stack.
CVE-2026-114469: Binary patch size check bypass.
Git rejects patches larger than roughly 1 GiB, because its patch application code does not work well with large files. But that check only considered the size of the patch as it appears in the input. For binary patches, that size is much smaller than the size of the file the patch describes, because binary patches are compressed and encoded. A binary patch that inflates to a very large size therefore slipped past the check. It then crashed Git with an out-of-bounds read in patchdelta(), when the truncated delta size exceeded the real buffer length.
Trigger: applying an attacker-supplied patch (e.g. git apply) that contains a binary diff which inflates far beyond 1 GiB.
CVE-2026-105437: Heap buffer overflow in the three-way merge code.
When merging, Git computes the size of the buffer holding the merge result in a way that can overflow for very large merges. A large number of conflicts combined with a large conflict-marker-size can trigger this. The resulting buffer can then be too small, and Git writes past its end (and, before and after that, before its start), corrupting the heap. In detail, libxdiff kept the merge output size in long/int variables and fed it to malloc(). The xdlfillmergebuffer() function then accumulates the output size in an int, allocates that much, and then writes each piece at dest + size. conflict-marker-size comes from .gitattributes, accepts any positive int, and is added several times per conflict. If the sum goes negative, malloc() gets a huge sizet and fails. That is a spurious error, not exploitable. If the sum wraps back to a small positive value, malloc() succeeds with a too-small buffer. Each added value is below 2^31, so the running offset passes through negative values on the way. The writes therefore first run past the end of the buffer and then land before its start.
Trigger: any command performing a textual three-way merge, i.e. git-merge, git-rebase, git-cherry-pick, and git-merge-tree. The latter is the likely target for forges, which may use it server-side to check mergeability. When the server reads attributes from trees (e.g. via attr.tree or --attr-source), anybody who can push branches and request a merge (e.g. open a pull/merge request) can trigger it. The amount of pushed data needed is small, because the oversized output only appears during the merge. A committed .gitattributes with a huge conflict-marker-size plus a file with many separate conflicts is enough. On GitLab this could be escalated further, to remote code execution via the Git process that Gitaly spawns for mergeability checks.
CVE-2026-114466: fast-import's rewrite-submodules features and export-pack-edges option allowed arbitrary file access.
In response to CVE-2019-1348, fast-import disallows the export-marks feature by default, because it gave arbitrary filesystem read/write access. The features rewrite-submodules-to and rewrite-submodules-from as well as the option export-pack-edges, introduced in the meantime, also allow reading from arbitrary paths. They are therefore now also disallowed by default. Concretely, the rewrite-submodules features take a file argument and can read arbitrary files. Given an unsuitable file, they fail with fatal: corrupt mark line: followed by that file's content. This leaks the content in the error message. Separately, export-pack-edges takes a file name and makes fast-import open it in append mode and write pack-edge records to it. The file is created even without any commits. With a commit plus transfer.unpackLimit=0, attacker-controlled data can be written into it. Both are now gated behind the existing --allow-unsafe-features option. This is a backwards-incompatible change. But, as with the earlier export-marks/import-marks change, the features are otherwise only useful to import/export remote helpers, so the impact should be minimal.
Trigger: feeding untrusted fast-import streams (e.g. git fast-import on input from an untrusted source) that use those features or options.
Credit for finding the vulnerabilities goes to Robert Chen (CVE-2026-111760), Luke Martin (CVE-2026-113408), and pwn2addr (CVE-2026-114466, CVE-2026-114467, CVE-2026-114469). Credit for fixing goes to Elijah Newren, with help from Johannes Schindelin and Jeff King and co-authored and reviewed by Toon Claes (CVE-2026-111760), Toon Claes (CVE-2026-113408), Karthik Nayak (CVE-2026-114466, CVE-2026-114467, CVE-2026-114469), and Kaartic Sivaraam, based on a patch by Jeff King, with help from Toon Claes and Christian Couder (CVE-2026-105437).
Ciao, Johannes
Certain fast-import features can access arbitrary paths and are now disallowed by default.
Affected versions of Git have a heap buffer overflow in the three-way merge code (xdiff), which an attacker can trigger through a repository they control.
When Git merges a file, it first adds up the size of the merged output, allocates a buffer of that size, and then writes the output into it. That total was kept in a 32-bit signed integer. The conflict-marker-size attribute, which can be set from a committed .gitattributes file, accepts any positive integer, and the markers are written several times for every conflict. A small file with a huge marker size and many separate conflicts can therefore push the total past 4 GiB, so the integer wraps to a small value and Git writes attacker-controlled merge output past the end of a buffer that is too small. At minimum this crashes Git, and because the overflow is large and its contents are largely attacker-controlled, worse heap corruption is possible.
Any command that does a textual three-way merge can trigger it, such as git-merge(1), git-rebase(1), git-cherry-pick(1), and git-merge-tree(1). The latter is most likely a target for Git forges, which might use git-merge-tree(1) on the server-side to check mergeability. When the server reads attributes from trees in the repository (for example through attr.tree or --attr-source), any user who can push branches and request that they be merged (for example by opening a pull or merge request) can trigger the overflow without anyone else doing anything, and the data they push is small because the oversized output only appears during the merge.
The problem has been patched by computing the size as sizet and checking every addition for overflow, so Git stops with an error instead of overflowing.
Servers that cannot upgrade right away can add
conflict-marker-size=7
to each repository's info/attributes as a workaround, which overrides any in-tree .gitattributes, or turn off server-side mergeability checks for untrusted repositories.
Removing more than two GPG signatures from commit messages can corrupt stack memory, potentially causing denial of service during merges.
A server can advertise a malformed unborn HEAD, causing unintended file writes during subsequent ref updates with the files ref backend.
Recursive clones can lead to remote code execution through unsafe handling of submodule-related repository metadata.
OpenAI Codex CLI for Windows, macOS, and Linux and Codex Desktop for Windows and macOS automatically collected Git repository metadata without disabling the repository-local core.fsmonitor setting. If a user opens or uses an attacker-prepared repository whose preserved .git/config sets core.fsmonitor to an attacker-controlled filesystem-monitor helper, Git can execute that helper while Codex collects repository metadata. The helper runs outside Codex's command sandbox and without a user-approval prompt, allowing attacker-controlled code to run with the user's privileges. The code can read, change, or delete the user's files and access other resources available to the user's account. An ordinary Git clone does not preserve the source repository's local .git/config; exploitation requires a repository delivered or copied with that configuration intact.
The flaw, tracked as CVE-2025-48384 (CVSS score of 8.1), is described as an arbitrary file write during the cloning of repositories with submodules that use a ‘recursive’ flag.
The issue exists because, when reading configuration values, Git strips trailing carriage return (CR) characters and does not quote them when writing.
Thus, the initialization of submodules with a path containing a trailing CR results in altered paths and in the submodule being checked out to an incorrect location.
“If a symlink exists that points the altered path to the submodule hooks directory, and the submodule contains an executable post-checkout hook, the script may be unintentionally executed after checkout,” Git’s advisory reads.
https://lore.kernel.org/git/xmqq5xg2wrd1.fsf@gitster.g
https://www.helpnetsecurity.com/2025/08/26/git-vulnerability-exploited-cve-2025-48384/
A Git repository can be crafted in such a way that a user who has cloned the repository can be tricked into running any script supplied by the attacker by invoking gitk filename, where filename has a particular structure.
When a user clones an untrusted repository and runs Gitk without additional command arguments, any writable file can be created and truncated. The option "Support per-file encoding" must have been enabled. The operation "Show origin of this line" is affected as well, regardless of the option being enabled or not.
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 internals. When reading a config value, Git strips any trailing carriage return and line feed (CRLF). When writing a config entry, values with a trailing CR are not quoted, causing the CR to be lost when the config is later read. When initializing a submodule, if the submodule path contains a trailing CR, the altered path is read resulting in the submodule being checked out to an incorrect location. If a symlink exists that points the altered path to the submodule hooks directory, and the submodule contains an executable post-checkout hook, the script may be unintentionally executed after checkout. This vulnerability is fixed in v2.43.7, v2.44.4, v2.45.4, v2.46.4, v2.47.3, v2.48.2, v2.49.1, and v2.50.1.
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 internals. When cloning a repository Git knows to optionally fetch a bundle advertised by the remote server, which allows the server-side to offload parts of the clone to a CDN. The Git client does not perform sufficient validation of the advertised bundles, which allows the remote side to perform protocol injection. This protocol injection can cause the client to write the fetched bundle to a location controlled by the adversary. The fetched content is fully controlled by the server, which can in the worst case lead to arbitrary code execution. The use of bundle URIs is not enabled by default and can be controlled by the bundle.heuristic config option. Some cases of the vulnerability require that the adversary is in control of where a repository will be cloned to. This either requires social engineering or a recursive clone with submodules. These cases can thus be avoided by disabling recursive clones. This vulnerability is fixed in v2.43.7, v2.44.4, v2.45.4, v2.46.4, v2.47.3, v2.48.2, v2.49.1, and v2.50.1.
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 internals. When reading a config value, Git strips any trailing carriage return and line feed (CRLF). When writing a config entry, values with a trailing CR are not quoted, causing the CR to be lost when the config is later read. When initializing a submodule, if the submodule path contains a trailing CR, the altered path is read resulting in the submodule being checked out to an incorrect location. If a symlink exists that points the altered path to the submodule hooks directory, and the submodule contains an executable post-checkout hook, the script may be unintentionally executed after checkout. This vulnerability is fixed in v2.43.7, v2.44.4, v2.45.4, v2.46.4, v2.47.3, v2.48.2, v2.49.1, and v2.50.1.
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 internals. When reading a config value, Git strips any trailing carriage return and line feed (CRLF). When writing a config entry, values with a trailing CR are not quoted, causing the CR to be lost when the config is later read. When initializing a submodule, if the submodule path contains a trailing CR, the altered path is read resulting in the submodule being checked out to an incorrect location. If a symlink exists that points the altered path to the submodule hooks directory, and the submodule contains an executable post-checkout hook, the script may be unintentionally executed after checkout. This vulnerability is fixed in v2.43.7, v2.44.4, v2.45.4, v2.46.4, v2.47.3, v2.48.2, v2.49.1, and v2.50.1.
CVE-2025-48384 is regarding a vulnerability in Git where when reading a config value, Git strips any trailing carriage return and line feed (CRLF). When writing a config entry, values with a trailing CR are not quoted, causing the CR to be lost when the config is later read. When initializing a submodule, if the submodule path contains a trailing CR, the altered path is read resulting in the submodule being checked out to an incorrect location. If a symlink exists that points the altered path to the submodule hooks directory, and the submodule contains an executable post-checkout hook, the script may be unintentionally executed after checkout. GitHub created this CVE on their behalf. The documented Visual Studio updates incorporate updates in Git which address this vulnerability. Please see CVE-2025-48384 for more information.
Git is a source code management tool. When cloning from a server (or fetching, or pushing), informational or error messages are transported from the remote Git process to the client via the so-called "sideband channel". These messages will be prefixed with "remote:" and printed directly to the standard error output. Typically, this standard error output is connected to a terminal that understands ANSI escape sequences, which Git did not protect against. Most modern terminals support control sequences that can be used by a malicious actor to hide and misrepresent information, or to mislead the user into executing untrusted scripts. As requested on the git-security mailing list, the patches are under discussion on the public mailing list. Users are advised to update as soon as possible. Users unable to upgrade should avoid recursive clones unless they are from trusted sources.
Git is a source code management tool. When cloning from a server (or fetching, or pushing), informational or error messages are transported from the remote Git process to the client via the so-called "sideband channel". These messages will be prefixed with "remote:" and printed directly to the standard error output. Typically, this standard error output is connected to a terminal that understands ANSI escape sequences, which Git did not protect against. Most modern terminals support control sequences that can be used by a malicious actor to hide and misrepresent information, or to mislead the user into executing untrusted scripts. As requested on the git-security mailing list, the patches are under discussion on the public mailing list. Users are advised to update as soon as possible. Users unable to upgrade should avoid recursive clones unless they are from trusted sources.
Git is a source code management tool. When cloning from a server (or fetching, or pushing), informational or error messages are transported from the remote Git process to the client via the so-called "sideband channel". These messages will be prefixed with "remote:" and printed directly to the standard error output. Typically, this standard error output is connected to a terminal that understands ANSI escape sequences, which Git did not protect against. Most modern terminals support control sequences that can be used by a malicious actor to hide and misrepresent information, or to mislead the user into executing untrusted scripts. As requested on the git-security mailing list, the patches are under discussion on the public mailing list. Users are advised to update as soon as possible. Users unable to upgrade should avoid recursive clones unless they are from trusted sources.
Git is a source code management tool. When cloning from a server (or fetching, or pushing), informational or error messages are transported from the remote Git process to the client via the so-called "sideband channel". These messages will be prefixed with "remote:" and printed directly to the standard error output. Typically, this standard error output is connected to a terminal that understands ANSI escape sequences, which Git did not protect against. Most modern terminals support control sequences that can be used by a malicious actor to hide and misrepresent information, or to mislead the user into executing untrusted scripts. As requested on the git-security mailing list, the patches are under discussion on the public mailing list. Users are advised to update as soon as possible. Users unable to upgrade should avoid recursive clones unless they are from trusted sources.
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 internals. Git defines a line-based protocol that is used to exchange information between Git and Git credential helpers. Some ecosystems (most notably, .NET and node.js) interpret single Carriage Return characters as newlines, which renders the protections against CVE-2020-5260 incomplete for credential helpers that treat Carriage Returns in this way. This issue has been addressed in commit b01b9b8 which is included in release versions v2.48.1, v2.47.1, v2.46.3, v2.45.3, v2.44.3, v2.43.6, v2.42.4, v2.41.3, and v2.40.4. Users are advised to upgrade. Users unable to upgrade should avoid cloning from untrusted URLs, especially recursive clones.
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 internals. When Git asks for credentials via a terminal prompt (i.e. without using any credential helper), it prints out the host name for which the user is expected to provide a username and/or a password. At this stage, any URL-encoded parts have been decoded already, and are printed verbatim. This allows attackers to craft URLs that contain ANSI escape sequences that the terminal interpret to confuse users e.g. into providing passwords for trusted Git hosting sites when in fact they are then sent to untrusted sites that are under the attacker's control. This issue has been patch via commits 7725b81 and c903985 which are included in release versions v2.48.1, v2.47.1, v2.46.3, v2.45.3, v2.44.3, v2.43.6, v2.42.4, v2.41.3, and v2.40.4. Users are advised to upgrade. Users unable to upgrade should avoid cloning from untrusted URLs, especially recursive clones.
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 internals. Git defines a line-based protocol that is used to exchange information between Git and Git credential helpers. Some ecosystems (most notably, .NET and node.js) interpret single Carriage Return characters as newlines, which renders the protections against CVE-2020-5260 incomplete for credential helpers that treat Carriage Returns in this way. This issue has been addressed in commit b01b9b8 which is included in release versions v2.48.1, v2.47.1, v2.46.3, v2.45.3, v2.44.3, v2.43.6, v2.42.4, v2.41.3, and v2.40.4. Users are advised to upgrade. Users unable to upgrade should avoid cloning from untrusted URLs, especially recursive clones.
Git does not sanitize URLs when asking for credentials interactively
Git is a revision control system. Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4, repositories with submodules can be crafted in a way that exploits a bug in Git whereby it can be fooled into writing files not into the submodule's worktree but into a .git/ directory. This allows writing a hook that will be executed while the clone operation is still running, giving the user no opportunity to inspect the code that is being executed. The problem has been patched in versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4. If symbolic link support is disabled in Git (e.g. via git config --global core.symlinks false), the described attack won't work. As always, it is best to avoid cloning repositories from untrusted sources.
Git is a revision control system. Prior to versions 2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1, a specially crafted .gitmodules file with submodule URLs that are longer than 1024 characters can used to exploit a bug in config.c::gitconfigcopyorrenamesectioninfile(). This bug can be used to inject arbitrary configuration into a user's $GITDIR/config when attempting to remove the configuration section associated with that submodule. When the attacker injects configuration values which specify executables to run (such as core.pager, core.editor, core.sshCommand, etc.) this can lead to a remote code execution. A fix A fix is available in versions 2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1. As a workaround, avoid running git submodule deinit on untrusted repositories or without prior inspection of any submodule sections in $GITDIR/config.