{"id":"CVE-2023-23946","published":"2023-02-14T19:48:00Z","modified":"2026-10-08T21:14:08Z","title":"Git's `git apply` overwriting paths outside the working tree","vendor":"git","product":"git","tier":"tail","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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.2,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01135,"percentile":0.6728,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/git/git/security/advisories/GHSA-r87m-v37r-cwfh","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/git/git/commit/c867e4fa180bec4750e9b54eb10f459030dbebfd","tags":["x_refsource_MISC"]},{"url":"https://security.gentoo.org/glsa/202312-15","tags":[]}],"priority":{"score":22.8,"factors":[{"name":"EPSS percentile","points":13.46},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":4.34}]},"exploitSources":{"pocGithub":{"count":2,"skipped":0,"earliest":"2023-09-07","earliestUrl":"https://github.com/bruno-1337/CVE-2023-23946-POC","repos":[{"name":"bruno-1337/CVE-2023-23946-POC","url":"https://github.com/bruno-1337/CVE-2023-23946-POC","stars":1,"created":"2023-09-07"},{"name":"tralsesec/CVE-2023-23946","url":"https://github.com/tralsesec/CVE-2023-23946","stars":0,"created":"2026-05-16"}]},"first":{"date":"2023-09-07","source":"PoC-in-GitHub","url":"https://github.com/bruno-1337/CVE-2023-23946-POC"},"provenance":"source"},"vendorSlug":"git","affectedVersions":[{"vendor":"git","product":"git","versions":[">= 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"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-10-08T21:13:34.517515Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2023-28012","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-git-cve-2023-22490","children":[{"from":"CVE-2023-23946","to":"CVE-2023-25652","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["apply.c","t/t4115-apply-symlink.sh"],"commits":["https://github.com/git/git/commit/c867e4fa180bec4750e9b54eb10f459030dbebfd","https://github.com/git/git/commit/18e2b1cfc80990719275d7b08e6e50f3e8cbc902","https://github.com/git/git/commit/668f2d53613ac8fd373926ebe219f2c29112d93e"],"basis":"shared function","functions":["apply_state"]},{"kind":"similar","provenance":"machine","score":0.56,"basis":"same product + CWE + description similarity"}]},{"from":"CVE-2023-23946","to":"CVE-2024-32020","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["builtin/clone.c"],"commits":["https://github.com/git/git/commit/c867e4fa180bec4750e9b54eb10f459030dbebfd","https://github.com/git/git/commit/1204e1a824c34071019fe106348eaa6d88f9528d","https://github.com/git/git/commit/9e65df5eab274bf74c7b570107aacd1303a1e703"],"basis":"rarely changed file"}]}]}}