CVE-2023-25652
"git apply --reject" partially-controlled arbitrary file write
Reported by github_m · Published April 25, 2023
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| git-daemon | Amazon Linux | 2.40.1-1.amzn2023.0.1 |
| git-subtree | Amazon Linux | 2.40.1-1.amzn2023.0.1, 2.40.1-1.amzn2.0.1 |
| gitweb | Amazon Linux | 2.40.1-1.amzn2023.0.1, 2.40.1-1.amzn2.0.1 |
| git-all | Amazon Linux | 2.40.1-1.amzn2023.0.1, 2.40.1-1.amzn2.0.1 |
| git-email | Amazon Linux | 2.40.1-1.amzn2023.0.1, 2.40.1-1.amzn2.0.1 |
| perl-Git-SVN | Amazon Linux | 2.40.1-1.amzn2023.0.1, 2.40.1-1.amzn2.0.1 |
| git | Amazon Linux | 2.40.1-1.amzn2023.0.1, 2.40.1-1.amzn2.0.1 |
| git-gui | Amazon Linux | 2.40.1-1.amzn2.0.1 |
| git-instaweb | Amazon Linux | 2.40.1-1.amzn2023.0.1 |
| git | Wolfi | 2.40.1-r0 |
| git-core | Amazon Linux | 2.40.1-1.amzn2023.0.1 |
| git-cvs | Amazon Linux | 2.40.1-1.amzn2.0.1 |
5 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| git | git | < 2.30.9, >= 2.31.0, < 2.31.8, >= 2.32.0, < 2.32.7 |
| amazon:2023 | git-daemon | 0 |
| amazon:2 | git-subtree | 0 |
| amazon:2023 | gitweb | 0 |
| amazon:2023 | git-all | 0 |
| amazon:2023 | git-email | 0 |
| amazon:2023 | git-subtree | 0 |
| amazon:2023 | perl-Git-SVN | 0 |
| amazon:2 | perl-Git-SVN | 0 |
| amazon:2023 | git | 0 |
| amazon:2 | git-gui | 0 |
| amazon:2 | git-email | 0 |
| amazon:2023 | git-instaweb | 0 |
| wolfi | git | 0 |
| amazon:2023 | git-core | 0 |
| amazon:2 | git-cvs | 0 |
| amazon:2 | git-svn | 0 |
| amazon:2 | gitk | 0 |
| amazon:2 | git | 0 |
| amazon:2 | git-credential-libsecret | 0 |
…and 19 more
Timeline
- Apr 25, 2023 CVE Published
- Apr 26, 2023 EPSS Score (30 in total, the first dated here)
- Feb 8, 2024 PoC Published
- Nov 4, 2025 CVE Updated
- Feb 20, 2026 Security Advisory (29 in total, the first dated here)
- Mar 21, 2026 Distribution Patch (24 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-25652
vulnetix vdb fixes CVE-2023-25652
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-25652/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/git/git/security/advisories/GHSA-2hvf-7c8p-28fx x_refsource_CONFIRM
- https://github.com/git/git/commit/18e2b1cfc80990719275d7b08e6e50f3e8cbc902 x_refsource_MISC
- https://github.com/git/git/commit/668f2d53613ac8fd373926ebe219f2c29112d93e x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2024/09/msg00009.html advisory