Git's `git apply` overwriting paths outside the working tree

Summary

CVECVE-2023-23946
StatePUBLISHED
AssignerGitHub_M
Source PriorityCVE Program / NVD first with legacy fallback
Published2023-02-14 20:15:17 UTC
Updated2026-10-08 22:17:23 UTC
DescriptionGit, 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.

Risk And Classification

Primary CVSS: v3.1 7.5 HIGH from [email protected]

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

Problem Types: CWE-22 | CWE-22 CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')


VersionSourceTypeScoreSeverityVector
3.1[email protected]Primary7.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
3.1[email protected]Secondary6.2MEDIUMCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
3.1CNADECLARED6.2MEDIUMCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

CVSS v3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

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

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Git-scm Git All All All All

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Git Git affected >= 2.39.0, < 2.39.2 Not specified
CNA Git Git affected >= 2.38.0, < 2.38.4 Not specified
CNA Git Git affected >= 2.37.0, < 2.37.6 Not specified
CNA Git Git affected >= 2.36.0, < 2.36.5 Not specified
CNA Git Git affected >= 2.35.0, < 2.35.7 Not specified
CNA Git Git affected >= 2.34.0, < 2.34.7 Not specified
CNA Git Git affected >= 2.33.0, < 2.33.7 Not specified
CNA Git Git affected >= 2.32.0, < 2.32.6 Not specified
CNA Git Git affected >= 2.31.0, < 2.31.7 Not specified
CNA Git Git affected < 2.30.8 Not specified

References

ReferenceSourceLinkTags
Sync with Git 2.39.2 · git/git@c867e4f · GitHub af854a3a-2127-422b-91ae-364da2661108 github.com Patch
"git apply" overwriting paths outside the working tree · Advisory · git/git · GitHub af854a3a-2127-422b-91ae-364da2661108 github.com Vendor Advisory
Git: Multiple Vulnerabilities (GLSA 202312-15) — Gentoo security af854a3a-2127-422b-91ae-364da2661108 security.gentoo.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Legacy QID Mappings

  • 160648 Oracle Enterprise Linux Security Update for git (ELSA-2023-3245)
  • 160686 Oracle Enterprise Linux Security Update for git (ELSA-2023-3246)
  • 181607 Debian Security Update for git (DLA 3338-1)
  • 181677 Debian Security Update for git (DSA 5357-1)
  • 184390 Debian Security Update for git (CVE-2023-23946)
  • 199174 Ubuntu Security Notification for Git Vulnerabilities (USN-5871-1)
  • 241549 Red Hat Update for git (RHSA-2023:3246)
  • 241551 Red Hat Update for git (RHSA-2023:3245)
  • 242859 Red Hat Update for git (RHSA-2024:0407)
  • 283708 Fedora Security Update for git (FEDORA-2023-5b372318ff)
  • 283733 Fedora Security Update for git (FEDORA-2023-2b3acb6cfd)
  • 354787 Amazon Linux Security Advisory for git : ALAS2-2023-1984
  • 354808 Amazon Linux Security Advisory for git : ALAS-2023-1700
  • 355065 Amazon Linux Security Advisory for git : AL2012-2023-389
  • 355274 Amazon Linux Security Advisory for git : ALAS2023-2023-113
  • 378539 Alibaba Cloud Linux Security Update for git (ALINUX3-SA-2023:0047)
  • 378542 GitLab Multiple Security Vulnerability (14-Feb-23)
  • 379259 GitLab Multiple Security Vulnerabilities (gitlab- 15.8.2, 15.7.7 and 15.6.8)
  • 502661 Alpine Linux Security Update for git
  • 502662 Alpine Linux Security Update for git
  • 502665 Alpine Linux Security Update for git
  • 502728 Alpine Linux Security Update for git
  • 503107 Alpine Linux Security Update for git
  • 505873 Alpine Linux Security Update for git
  • 673004 EulerOS Security Update for git (EulerOS-SA-2023-1841)
  • 673007 EulerOS Security Update for git (EulerOS-SA-2023-1866)
  • 673014 EulerOS Security Update for git (EulerOS-SA-2023-1951)
  • 673023 EulerOS Security Update for git (EulerOS-SA-2023-1973)
  • 673069 EulerOS Security Update for git (EulerOS-SA-2023-2145)
  • 673139 EulerOS Security Update for git (EulerOS-SA-2023-2289)
  • 673140 EulerOS Security Update for git (EulerOS-SA-2023-2265)
  • 691067 Free Berkeley Software Distribution (FreeBSD) Security Update for git (21f12de8-b1db-11ed-b0f4-002590f2a714)
  • 710816 Gentoo Linux Git Multiple Vulnerabilities (GLSA 202312-15)
  • 753695 SUSE Enterprise Linux Security Update for git (SUSE-SU-2023:0426-1)
  • 753699 SUSE Enterprise Linux Security Update for git (SUSE-SU-2023:0418-1)
  • 753706 SUSE Enterprise Linux Security Update for git (SUSE-SU-2023:0430-1)
  • 905556 Common Base Linux Mariner (CBL-Mariner) Security Update for git (13573)
  • 906549 Common Base Linux Mariner (CBL-Mariner) Security Update for git (13573-1)
  • 906602 Common Base Linux Mariner (CBL-Mariner) Security Update for git (13573-3)
  • 906782 Common Base Linux Mariner (CBL-Mariner) Security Update for git (13573-5)
  • 91992 Microsoft Visual Studio Security Updates for March 2023
  • 941120 AlmaLinux Security Update for git (ALSA-2023:3246)
  • 941122 AlmaLinux Security Update for git (ALSA-2023:3245)
  • 960936 Rocky Linux Security Update for git (RLSA-2023:3246)

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report