# CVE-2023-23946: Git's \`git apply\` overwriting paths outside the working tree

- Priority: **Routine**
- Reason: Not severe (CVSS 6.2, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2023-02-14 · Modified: 2026-10-08
- Aliases: ALPINE-CVE-2023-23946, UBUNTU-CVE-2023-23946, DEBIAN-CVE-2023-23946, CGA-973m-xjh9-w8h6, CGA-wvx4-x57w-xwjg
- Record: https://cvemate.com/vulnerability/CVE-2023-23946 · JSON: https://cvemate.com/vulnerability/CVE-2023-23946/json

## Description

```text
Git, a revision control system, is vulnerable to path traversal prior to versions 2.39.2, 2.38.4, 2.37.6, 2.36.5, 2.35.7, 2.34.7, 2.33.7, 2.32.6, 2.31.7, and 2.30.8. By feeding a crafted input to `git apply`, a path outside the working tree can be overwritten as the user who is running `git apply`. A fix has been prepared and will appear in v2.39.2, v2.38.4, v2.37.6, v2.36.5, v2.35.7, v2.34.7, v2.33.7, v2.32.6, v2.31.7, and v2.30.8. As a workaround, use `git apply --stat` to inspect a patch before applying; avoid applying one that creates a symbolic link and then creates a file beyond the symbolic link.
```

## Signals

- CVSS: 7.5 high (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- EPSS: 1.145%, percentile 67.825%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine git (Alpine Linux): ≥ 2.31.0, \< 2.32.6-r0 \| ≥ 2.31.0, \< 2.34.7-r0 \| ≥ 2.31.0, \< 2.36.5-r0 \| ≥ 2.31.0, \< 2.38.4-r0 \| ≥ 2.31.0, \< 2.39.2-r0 \| ≥ 2.32.0, \< 2.32.6-r0 \| ≥ 2.34.0, \< 2.34.7-r0 \| ≥ 2.36.0, \< 2.36.5-r0 \| ≥ 2.38.0, \< 2.38.4-r0 \| ≥ 2.39.0, \< 2.39.2-r0
- chainguard git (Chainguard): \< 2.39.2-r1
- wolfi git (Wolfi): \< 2.39.2-r1
- debian git (Debian): \< 1:2.39.2-1
- ubuntu git (Ubuntu): \< 1:2.7.4-0ubuntu1.10+esm5 \| \< 1:2.17.1-1ubuntu0.16 \| \< 1:2.25.1-1ubuntu3.10 \| \< 1:2.34.1-1ubuntu1.8
- git-scm git: \< 2.30.8 \| ≥ 2.31.0, \< 2.31.7 \| ≥ 2.32.0, \< 2.32.6 \| ≥ 2.33.0, \< 2.33.7 \| ≥ 2.34.0, \< 2.34.7 \| ≥ 2.35.0, \< 2.35.7 \| ≥ 2.36.0, \< 2.36.5 \| ≥ 2.37.0, \< 2.37.6 \| ≥ 2.38.0, \< 2.38.4 \| ≥ 2.39.0, \< 2.39.2
- git git: ≥ 2.39.0, \< 2.39.2 \| ≥ 2.38.0, \< 2.38.4 \| ≥ 2.37.0, \< 2.37.6 \| ≥ 2.36.0, \< 2.36.5 \| ≥ 2.35.0, \< 2.35.7 \| ≥ 2.34.0, \< 2.34.7 \| ≥ 2.33.0, \< 2.33.7 \| ≥ 2.32.0, \< 2.32.6 \| ≥ 2.31.0, \< 2.31.7 \| \< 2.30.8

## References

- <https://github.com/git/git/security/advisories/GHSA-r87m-v37r-cwfh>
- <https://github.com/git/git/commit/c867e4fa180bec4750e9b54eb10f459030dbebfd>
- <https://security.gentoo.org/glsa/202312-15>
- <https://security.alpinelinux.org/vuln/CVE-2023-23946>
- <https://ubuntu.com/security/CVE-2023-23946>
- <https://ubuntu.com/security/notices/USN-5871-1>
- <https://www.cve.org/CVERecord?id=CVE-2023-23946>
- <https://security-tracker.debian.org/tracker/CVE-2023-23946>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/23xxx/CVE-2023-23946.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2023-23946>

---

Data as of 2026-12-05T03:06:14.161Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
