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

Published Feb 8, 2023
·
Updated

A user can feed a specially crafted input to git apply to overwrite a path outside the working tree.

Other sources

A vulnerability was found in Git. This security issue occurs when feeding a crafted input to "git apply." A path outside the working tree can be overwritten by the user running "git apply."

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".

Red Hat

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.

GitHub: CVE-2023-23946 mingit Remote Code Execution Vulnerability

Affected Software

17 affected componentsFixes available
redhat/git<0:2.39.3-1.el8_8
0:2.39.3-1.el8_8
redhat/git<0:2.39.3-1.el9_2
0:2.39.3-1.el9_2
git-scm Git<2.30.8
git-scm Git>=2.31.0<2.31.7
git-scm Git>=2.32.0<2.32.6
git-scm Git>=2.33.0<2.33.7
git-scm Git>=2.34.0<2.34.7
git-scm Git>=2.35.0<2.35.7
git-scm Git>=2.36.0<2.36.5
git-scm Git>=2.37.0<2.37.6
git-scm Git>=2.38.0<2.38.4
git-scm Git>=2.39.0<2.39.2
Microsoft Visual Studio 2019 (includes 16.0 - 16.10)=16.11
Microsoft Visual Studio 2017 (includes 15.0 - 15.8)=15.9
Microsoft Visual Studio 2022=17.2
Microsoft Visual Studio 2022=17.4
Microsoft Visual Studio 2022=17.0

Remediation

Information

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.

Event History

Feb 8, 2023
Data Sourced
via Red Hat·10:44 AM
DescriptionSeverityAffected Software
Feb 14, 2023
CVE Published
12:00 AM
Data Sourced
via GitLab·12:00 AM
Description
CVE Published
via MITRE·07:48 PM
Data Sourced
via MITRE·07:48 PM
DescriptionSeverityWeakness
Mar 14, 2023
Data Sourced
07:00 AM
DescriptionSeverityWeakness

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-23946?

CVE-2023-23946 is a vulnerability in the Git revision control system that allows remote code execution via path traversal.

2

Which software versions are affected by CVE-2023-23946?

CVE-2023-23946 affects 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 of Git.

3

What is the severity of CVE-2023-23946?

CVE-2023-23946 has a severity score of 7, which is considered high.

4

How can I fix CVE-2023-23946 in Visual Studio 2022 version 17.2?

To fix CVE-2023-23946 in Visual Studio 2022 version 17.2, you can either update to a version that includes the patch, or apply the patch manually by downloading it from the provided URL.

5

Where can I find more information about CVE-2023-23946?

You can find more information about CVE-2023-23946 on the Microsoft Security Response Center website, as well as the Bugzilla and Red Hat access pages linked in the references.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203