git — security advisory
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.
- Products
- git
- Affected versions
- 1:2.39.2+next.20230215-1, 1:2.39.2-1.1
- Fixed versions
- 1:2.39.5-0+deb12u1, 1:2.40.1-1
- CVEs
- CVE-2023-25652
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 15:28 UTC · Revision 1
Source evidence
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.
osv:DEBIAN-CVE-2023-25652
git
Fixed versions: 1:2.39.5-0+deb12u1
git
Fixed versions: 1:2.40.1-1
git
Fixed versions: 1:2.40.1-1
Complete source record
{
"id": "713212eb81f47f586a68ef86f9c962cd0030bca62b5289699032f3700ecd7730",
"url": "https://osv.dev/vulnerability/DEBIAN-CVE-2023-25652",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DEBIAN-CVE-2023-25652",
"summary": "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.",
"evidence": "osv:DEBIAN-CVE-2023-25652",
"products": [
{
"name": {
"value": "git",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1:2.39.5-0+deb12u1",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": [
{
"value": "1:2.39.2+next.20230215-1",
"evidence": "/affected/0/versions"
},
{
"value": "1:2.39.2-1.1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "git",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1:2.40.1-1",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "git",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1:2.40.1-1",
"evidence": "/affected/2/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "DEBIAN-CVE-2023-25652",
"aliases": [
"DEBIAN-CVE-2023-25652"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1:2.39.5-0+deb12u1"
}
]
}
],
"package": {
"name": "git",
"purl": "pkg:deb/debian/git?arch=source&distro=bookworm",
"ecosystem": "Debian:12"
},
"versions": [
"1:2.39.2+next.20230215-1",
"1:2.39.2-1.1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-25652.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1:2.40.1-1"
}
]
}
],
"package": {
"name": "git",
"purl": "pkg:deb/debian/git?arch=source&distro=trixie",
"ecosystem": "Debian:13"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-25652.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1:2.40.1-1"
}
]
}
],
"package": {
"name": "git",
"purl": "pkg:deb/debian/git?arch=source&distro=forky",
"ecosystem": "Debian:14"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2023-25652.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
}
],
"modified": "2026-10-26T18:00:43.907686849Z",
"provider": "osv",
"upstream": [
"CVE-2023-25652"
],
"references": [
"https://security-tracker.debian.org/tracker/CVE-2023-25652"
]
},
"related_cves": [
{
"value": "CVE-2023-25652",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 455150,
"published_at": "2023-04-25T20:15:09.933+00:00"
}