← Vulnerability feed

Vulnerability record · CVE-2023-25652 · published 25 April 2023

CVE-2023-25652: Git apply --reject path traversal allows file overwrite outside working tree

Git Scm · Git

Git before the fixed releases mishandles specially crafted input to `git apply --reject`, allowing a path outside the working tree to be overwritten with partially controlled contents taken from the rejected hunks of a patch. Because the overwritten content is only partially controlled, the flaw is primarily an integrity and denial-of-service risk to files the Git process can write. It matters because applying patches from untrusted sources is common in review and CI workflows.

7.5 CVSS 3.1 High EPSS 52% · top 1.1% CWE-22 · Path traversal
7.5CVSS 3.1 base score
52%EPSS exploitation probability, 30 days
NoNot in CISA KEV
2Affected product versions listed by NVD
21References
17 Jun 2026Last modified by NVD

Description

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, by feeding specially crafted input to `git apply --reject`, a path outside the working tree can be overwritten with partially controlled contents (corresponding to the rejected hunk(s) from the given patch). 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 using `git apply` with `--reject` when applying patches from an untrusted source. Use `git apply --stat` to inspect a patch before applying; avoid applying one that create a conflict where a link corresponding to the `*.rej` file exists.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 20 September 2026. Confidence: high.

high priorityCVSS 7.5 with a high EPSS percentile and a straightforward path traversal in a widely deployed tool, though exploitation requires applying an untrusted patch.

What it is

Git before the fixed releases mishandles specially crafted input to `git apply --reject`, allowing a path outside the working tree to be overwritten with partially controlled contents taken from the rejected hunks of a patch. Because the overwritten content is only partially controlled, the flaw is primarily an integrity and denial-of-service risk to files the Git process can write. It matters because applying patches from untrusted sources is common in review and CI workflows.

Impact

An attacker who supplies a malicious patch can overwrite files outside the repository working tree with partially controlled data, corrupting or replacing content the Git user can write. There is no confidentiality impact per the CVSS vector; the gain is integrity tampering and potential disruption.

Attack surface

Reached by feeding a crafted patch to `git apply --reject`, typically when a user or automated pipeline applies a patch from an untrusted source. The CVSS vector is network, no privileges, no user interaction, but in practice exploitation requires the victim to run the command against attacker-supplied input.

Exploitation

Not listed in CISA KEV and no public exploit or ransomware association is recorded in this data. EPSS is high at roughly 0.519 (98.9th percentile), indicating elevated predicted exploitation likelihood, and references include patch and vendor advisory links.

What to do

  • Upgrade Git to 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, or 2.40.1 (or later).
  • Update distribution packages (Fedora, Debian LTS, Gentoo) to the fixed builds referenced in the advisories.
  • Avoid `git apply --reject` on patches from untrusted sources; inspect patches with `git apply --stat` first.
  • Do not apply patches that create a conflict where a `*.rej` link already exists.
  • Run patch application in a sandbox or low-privilege account with a restricted working directory.

Detection

  • Monitor for `git apply` invocations using `--reject` in CI and developer shell history or process telemetry.
  • Alert on writes to paths outside expected repository roots during patch application, especially `*.rej`-related paths.
  • Watch for unexpected modification of files outside the working tree by the Git process user.
  • Review patch sources and repositories for crafted patches that intentionally produce rejected hunks.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://www.openwall.com/lists/oss-security/2023/04/25/2 Mailing ListThird Party Advisory
https://github.com/git/git/commit/18e2b1cfc80990719275d7b08e6e50f3e8cbc902 Patch
https://github.com/git/git/commit/668f2d53613ac8fd373926ebe219f2c29112d93e Patch
https://github.com/git/git/security/advisories/GHSA-2hvf-7c8p-28fx Vendor Advisory
https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html
https://lists.fedoraproject.org/archives/list/[email protected]/message/BSXOGVVBJLYX26IAYX6PJSYQB
https://lists.fedoraproject.org/archives/list/[email protected]/message/PI7FZ4NNR5S5J5K6AMVQBH2JF Mailing ListThird Party Advisory
https://lists.fedoraproject.org/archives/list/[email protected]/message/RKOXOAZ42HLXHXTW6JZI4L5DA
https://lists.fedoraproject.org/archives/list/[email protected]/message/YFZWGQKB6MM5MNF2DLFTD7KS2 Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/202312-15
http://www.openwall.com/lists/oss-security/2023/04/25/2 Mailing ListThird Party Advisory
https://github.com/git/git/commit/18e2b1cfc80990719275d7b08e6e50f3e8cbc902 Patch
https://github.com/git/git/commit/668f2d53613ac8fd373926ebe219f2c29112d93e Patch
https://github.com/git/git/security/advisories/GHSA-2hvf-7c8p-28fx Vendor Advisory
https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html
https://lists.debian.org/debian-lts-announce/2024/09/msg00009.html
https://lists.fedoraproject.org/archives/list/[email protected]/message/BSXOGVVBJLYX26IAYX6PJSYQB
https://lists.fedoraproject.org/archives/list/[email protected]/message/PI7FZ4NNR5S5J5K6AMVQBH2JF Mailing ListThird Party Advisory
https://lists.fedoraproject.org/archives/list/[email protected]/message/RKOXOAZ42HLXHXTW6JZI4L5DA
https://lists.fedoraproject.org/archives/list/[email protected]/message/YFZWGQKB6MM5MNF2DLFTD7KS2 Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/202312-15

Track CVE-2023-25652 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2024-4577PHP-CGI on Windows argument injection leads to remote code executionPHP-CGI on Windows can misinterpret characters in the command line passed to Win32 API functions when certain code pages are configured, due to Windo…KEVEPSS 100%analysed9.8CVE-2021-44026Roundcube Webmail SQL injection via search parametersRoundcube Webmail before 1.3.17 and 1.4.x before 1.4.12 is prone to SQL injection through the search or search_params input. The flaw is remotely rea…KEVEPSS 70%analysed9.8CVE-2021-42013Apache HTTP Server path traversal and RCE via incomplete fixThe fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient, leaving a path traversal flaw that lets attackers map URLs to files outside…KEVEPSS 100%analysed9.8CVE-2021-41773Apache HTTP Server 2.4.49 path traversal and RCEA path normalization flaw introduced in Apache HTTP Server 2.4.49 lets attackers map URLs to files outside directories configured by Alias-like direc…KEVEPSS 100%analysed9.8CVE-2021-1870Apple WebKit logic flaw allows remote code executionA logic issue in Apple's WebKit was addressed with improved restrictions, affecting macOS Big Sur, Catalina, Mojave, iOS and iPadOS, plus WebKitGTK a…KEVEPSS 7.7%analysed9.8CVE-2021-1871Apple WebKit logic flaw allows remote code executionA logic issue in Apple's WebKit was addressed with improved restrictions. It affects macOS Big Sur, Catalina, Mojave, iOS and iPadOS, and a remote at…KEVEPSS 7.0%analysed9.8CVE-2020-16846SaltStack Salt API shell injection via crafted web requestsSaltStack Salt through 3002 is vulnerable to OS command injection when the SSH client is enabled and crafted web requests are sent to the Salt API. T…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2023-25652), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.