Path Traversal in Git git apply
CVE-2023-23946 is a path-traversal vulnerability in Git's git apply command affecting versions before 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. A crafted patch can create a symbolic link and subsequently create or overwrite a file through that link outside the repository working tree. The write occurs with the filesystem permissions of the user executing git apply.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
An attacker can cause git apply to overwrite filesystem paths outside the working tree that are writable by the user applying the crafted patch. This can compromise the integrity of user-accessible files.
If you can’t patch tonight, do this now.
Before applying untrusted patches, inspect them with git apply --stat. Do not apply a patch that creates a symbolic link and then creates a file beyond that symbolic link.
Patch, then assume compromise.
Upgrade Git to version 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, or 2.30.8, as appropriate for the maintained release branch.
2 exploits validated by Mallory's analysis.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.