CVE-2023-25652
"git apply --reject" partially-controlled arbitrary file write
Check your servers for CVE-2023-25652
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-25652 affects git, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity high, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 1.77%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 78.5% of all scored CVEs. Scores of 29 Nov 2026.
The assessment of CISA (SSVC, 5 Jan 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| git |
affected < 2.30.9 affected >= 2.31.0, < 2.31.8 affected >= 2.32.0, < 2.32.7 affected >= 2.33.0, < 2.33.8 affected >= 2.34.0, < 2.34.8 affected >= 2.35.0, < 2.35.8 affected >= 2.36.0, < 2.36.6 affected >= 2.37.0, < 2.37.7 affected >= 2.38.0, < 2.38.5 affected >= 2.39.0, < 2.39.3 affected >= 2.40.0, < 2.40.1
|
Is my server affected?
Find the installed version of git and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i git
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-25652 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-25652RHEL, Rocky, Alma, Fedora
rpm -q git
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-25652Alpine
apk list --installed | grep -i gitWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2023-25652
trivy image --scanners vuln IMAGE | grep CVE-2023-25652
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
Other references
- https://github.com/git/git/commit/18e2b1cfc80990719275d7b08e6e50f3e8cbc902 github.com
- https://github.com/git/git/commit/668f2d53613ac8fd373926ebe219f2c29112d93e github.com
- http://www.openwall.com/lists/oss-security/2023/04/25/2 openwall.com
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PI7FZ4NNR5S5J5K6AMVQBH2JFP6NE4L7/ lists.fedoraproject.org
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YFZWGQKB6MM5MNF2DLFTD7KS2KWPICKL/ lists.fedoraproject.org
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RKOXOAZ42HLXHXTW6JZI4L5DAIYDTYCU/ lists.fedoraproject.org
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BSXOGVVBJLYX26IAYX6PJSYQB36BREWH/ lists.fedoraproject.org
- https://security.gentoo.org/glsa/202312-15 security.gentoo.org
- https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html lists.debian.org
- https://lists.debian.org/debian-lts-announce/2024/09/msg00009.html lists.debian.org
Source: the record CVE-2023-25652 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse