{"id":"CVE-2023-23946","summary":"Git's `git apply` overwriting paths outside the working tree","details":"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.","aliases":["GHSA-r87m-v37r-cwfh"],"modified":"2026-04-16T04:32:47.595066659Z","published":"2023-02-14T19:48:00.554Z","related":["ALSA-2023:3245","ALSA-2023:3246","CGA-mwr5-cfgm-mv44","SUSE-SU-2023:0418-1","SUSE-SU-2023:0426-1","SUSE-SU-2023:0430-1","openSUSE-SU-2024:12698-1"],"database_specific":{"cwe_ids":["CWE-22"],"cna_assigner":"GitHub_M","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/23xxx/CVE-2023-23946.json"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/23xxx/CVE-2023-23946.json"},{"type":"ADVISORY","url":"https://github.com/git/git/security/advisories/GHSA-r87m-v37r-cwfh"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23946"},{"type":"ADVISORY","url":"https://security.gentoo.org/glsa/202312-15"},{"type":"FIX","url":"https://github.com/git/git/commit/c867e4fa180bec4750e9b54eb10f459030dbebfd"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"c48035d29b4e524aed3a32f0403676f0d9128863"},{"fixed":"cbf04937d5b9fcf0a76c28f69e6294e9e3ecd7e6"}],"database_specific":{"versions":[{"introduced":"2.39.0"},{"fixed":"2.39.2"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"3dcec76d9df911ed8321007b1d197c1a206dc164"},{"fixed":"7556e5d737b917d31ac3729b0f5e2391da7e132a"}],"database_specific":{"versions":[{"introduced":"2.38.0"},{"fixed":"2.38.4"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"e4a4b31577c7419497ac30cebe30d755b97752c5"},{"fixed":"eb88fe1ff5ceb34845f0919b8bdc60d8a1703cf6"}],"database_specific":{"versions":[{"introduced":"2.37.0"},{"fixed":"2.37.6"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e"},{"fixed":"673472a9635805d3b1fcd0038ecc0a9418078685"}],"database_specific":{"versions":[{"introduced":"2.36.0"},{"fixed":"2.36.5"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"89bece5c8c96f0b962cfc89e63f82d603fd60bed"},{"fixed":"b7a92d078b9b9a39553623815699eb029074e39d"}],"database_specific":{"versions":[{"introduced":"2.35.0"},{"fixed":"2.35.7"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"cd3e606211bb1cf8bc57f7d76bab98cc17a150bc"},{"fixed":"91da4a29e168ab465beb713fca4d389193f8f16c"}],"database_specific":{"versions":[{"introduced":"2.34.0"},{"fixed":"2.34.7"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"225bc32a989d7a22fa6addafd4ce7dcd04675dbf"},{"fixed":"ed4404af3c936d87ac2c6ff12cc3da495511bec9"}],"database_specific":{"versions":[{"introduced":"2.33.0"},{"fixed":"2.33.7"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"ebf3c04b262aa27fbb97f8a0156c2347fecafafb"},{"fixed":"2aedeff35fde779b03b57125b1f50f6c528bfbea"}],"database_specific":{"versions":[{"introduced":"2.32.0"},{"fixed":"2.32.6"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"a5828ae6b52137b913b978e16cd2334482eb4c1f"},{"fixed":"0bbcf951943eefbbfee2a7e08b7150bef5b60562"}],"database_specific":{"versions":[{"introduced":"2.31.0"},{"fixed":"2.31.7"}]}},{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"0"},{"fixed":"394a759d2b5f0a1a1908c820cf142f45cb78718c"}],"database_specific":{"versions":[{"introduced":"0"},{"fixed":"2.30.8"}]}}],"versions":["v0.99","v0.99.1","v0.99.2","v0.99.3","v0.99.4","v0.99.5","v0.99.6","v0.99.7","v0.99.8","v0.99.8a","v0.99.8b","v0.99.8c","v0.99.8d","v0.99.8e","v0.99.8f","v0.99.8g","v0.99.9a","v0.99.9b","v0.99.9c","v0.99.9d","v0.99.9e","v0.99.9f","v0.99.9g","v0.99.9h","v0.99.9i","v0.99.9j","v0.99.9k","v0.99.9l","v0.99.9m","v0.99.9n","v1.0.0","v1.0rc1","v1.0rc2","v1.0rc3","v1.0rc4","v1.0rc5","v1.0rc6","v1.1.0","v1.2.0","v1.3.0-rc1","v1.4.1","v1.4.1-rc1","v1.4.1-rc2","v1.4.2","v1.4.2-rc1","v1.4.2-rc2","v1.4.2-rc3","v1.4.2-rc4","v1.4.3","v1.4.3-rc1","v1.4.3-rc2","v1.4.3-rc3","v1.4.4","v1.4.4-rc1","v1.4.4-rc2","v1.4.4.1","v1.5.0","v1.5.0-rc0","v1.5.0-rc1","v1.5.0-rc2","v1.5.0-rc3","v1.5.0-rc4","v1.5.1","v1.5.1-rc1","v1.5.1-rc2","v1.5.1-rc3","v1.5.2","v1.5.2-rc0","v1.5.2-rc1","v1.5.2-rc2","v1.5.2-rc3","v1.5.3","v1.5.3-rc0","v1.5.3-rc1","v1.5.3-rc2","v1.5.3-rc3","v1.5.3-rc4","v1.5.3-rc5","v1.5.3-rc6","v1.5.3-rc7","v1.5.3.1","v1.5.4","v1.5.4-rc0","v1.5.4-rc1","v1.5.4-rc2","v1.5.4-rc3","v1.5.4-rc4","v1.5.4-rc5","v1.5.5","v1.5.5-rc0","v1.5.5-rc1","v1.5.5-rc2","v1.5.5-rc3","v1.5.6","v1.5.6-rc0","v1.5.6-rc1","v1.5.6-rc2","v1.5.6-rc3","v1.6.0","v1.6.0-rc0","v1.6.0-rc1","v1.6.0-rc2","v1.6.0-rc3","v1.6.1","v1.6.1-rc1","v1.6.1-rc2","v1.6.1-rc3","v1.6.1-rc4","v1.6.2","v1.6.2-rc0","v1.6.2-rc1","v1.6.2-rc2","v1.6.3","v1.6.3-rc0","v1.6.3-rc1","v1.6.3-rc2","v1.6.3-rc3","v1.6.3-rc4","v1.6.4","v1.6.4-rc0","v1.6.4-rc1","v1.6.4-rc2","v1.6.4-rc3","v1.6.5","v1.6.5-rc0","v1.6.5-rc1","v1.6.5-rc2","v1.6.5-rc3","v1.6.6","v1.6.6-rc0","v1.6.6-rc1","v1.6.6-rc2","v1.6.6-rc3","v1.6.6-rc4","v1.7.0","v1.7.0-rc0","v1.7.0-rc1","v1.7.0-rc2","v1.7.1","v1.7.1-rc0","v1.7.1-rc1","v1.7.1-rc2","v1.7.10","v1.7.10-rc0","v1.7.10-rc1","v1.7.10-rc2","v1.7.10-rc3","v1.7.10-rc4","v1.7.11","v1.7.11-rc0","v1.7.11-rc1","v1.7.11-rc2","v1.7.11-rc3","v1.7.12","v1.7.12-rc0","v1.7.12-rc1","v1.7.12-rc2","v1.7.12-rc3","v1.7.2","v1.7.2-rc0","v1.7.2-rc1","v1.7.2-rc2","v1.7.2-rc3","v1.7.3","v1.7.3-rc0","v1.7.3-rc1","v1.7.3-rc2","v1.7.3.1","v1.7.4","v1.7.4-rc0","v1.7.4-rc1","v1.7.4-rc2","v1.7.4-rc3","v1.7.5","v1.7.5-rc0","v1.7.5-rc1","v1.7.5-rc2","v1.7.5-rc3","v1.7.6","v1.7.6-rc0","v1.7.6-rc1","v1.7.6-rc2","v1.7.6-rc3","v1.7.7","v1.7.7-rc0","v1.7.7-rc1","v1.7.7-rc2","v1.7.7-rc3","v1.7.8","v1.7.8-rc0","v1.7.8-rc1","v1.7.8-rc2","v1.7.8-rc3","v1.7.8-rc4","v1.7.9","v1.7.9-rc0","v1.7.9-rc1","v1.7.9-rc2","v1.8.0","v1.8.0-rc0","v1.8.0-rc1","v1.8.0-rc2","v1.8.0-rc3","v1.8.1","v1.8.1-rc0","v1.8.1-rc1","v1.8.1-rc2","v1.8.1-rc3","v1.8.2","v1.8.2-rc0","v1.8.2-rc1","v1.8.2-rc2","v1.8.2-rc3","v1.8.3","v1.8.3-rc0","v1.8.3-rc1","v1.8.3-rc2","v1.8.3-rc3","v1.8.4","v1.8.4-rc0","v1.8.4-rc1","v1.8.4-rc2","v1.8.4-rc3","v1.8.4-rc4","v1.8.5","v1.8.5-rc0","v1.8.5-rc1","v1.8.5-rc2","v1.8.5-rc3","v1.9-rc0","v1.9-rc1","v1.9-rc2","v1.9.0","v1.9.0-rc3","v2.0.0","v2.0.0-rc0","v2.0.0-rc1","v2.0.0-rc2","v2.0.0-rc3","v2.0.0-rc4","v2.1.0","v2.1.0-rc0","v2.1.0-rc1","v2.1.0-rc2","v2.10.0","v2.10.0-rc0","v2.10.0-rc1","v2.10.0-rc2","v2.11.0","v2.11.0-rc0","v2.11.0-rc1","v2.11.0-rc2","v2.11.0-rc3","v2.12.0","v2.12.0-rc0","v2.12.0-rc1","v2.12.0-rc2","v2.13.0","v2.13.0-rc0","v2.13.0-rc1","v2.13.0-rc2","v2.14.0","v2.14.0-rc0","v2.14.0-rc1","v2.15.0","v2.15.0-rc0","v2.15.0-rc1","v2.15.0-rc2","v2.16.0","v2.16.0-rc0","v2.16.0-rc1","v2.16.0-rc2","v2.17.0","v2.17.0-rc0","v2.17.0-rc1","v2.17.0-rc2","v2.18.0","v2.18.0-rc0","v2.18.0-rc1","v2.18.0-rc2","v2.19.0","v2.19.0-rc0","v2.19.0-rc1","v2.19.0-rc2","v2.2.0","v2.2.0-rc0","v2.2.0-rc1","v2.2.0-rc2","v2.2.0-rc3","v2.20.0","v2.20.0-rc0","v2.20.0-rc1","v2.20.0-rc2","v2.21.0","v2.21.0-rc0","v2.21.0-rc1","v2.21.0-rc2","v2.22.0","v2.22.0-rc0","v2.22.0-rc1","v2.22.0-rc2","v2.22.0-rc3","v2.23.0","v2.23.0-rc0","v2.23.0-rc1","v2.23.0-rc2","v2.24.0","v2.24.0-rc0","v2.24.0-rc1","v2.24.0-rc2","v2.25.0","v2.25.0-rc0","v2.25.0-rc1","v2.25.0-rc2","v2.26.0","v2.26.0-rc0","v2.26.0-rc1","v2.26.0-rc2","v2.27.0","v2.27.0-rc0","v2.27.0-rc1","v2.27.0-rc2","v2.28.0","v2.28.0-rc0","v2.28.0-rc1","v2.28.0-rc2","v2.29.0","v2.29.0-rc0","v2.29.0-rc1","v2.29.0-rc2","v2.3.0","v2.3.0-rc0","v2.3.0-rc1","v2.3.0-rc2","v2.30.0","v2.30.0-rc0","v2.30.0-rc1","v2.30.0-rc2","v2.30.1","v2.30.2","v2.30.3","v2.30.4","v2.30.5","v2.30.6","v2.30.7","v2.31.0","v2.31.1","v2.31.2","v2.31.3","v2.31.4","v2.31.5","v2.31.6","v2.32.0","v2.32.1","v2.32.2","v2.32.3","v2.32.4","v2.32.5","v2.33.0","v2.33.1","v2.33.2","v2.33.3","v2.33.4","v2.33.5","v2.33.6","v2.34.0","v2.34.1","v2.34.2","v2.34.3","v2.34.4","v2.34.5","v2.34.6","v2.35.0","v2.35.1","v2.35.2","v2.35.3","v2.35.4","v2.35.5","v2.35.6","v2.36.0","v2.36.1","v2.36.2","v2.36.3","v2.36.4","v2.37.0","v2.37.1","v2.37.2","v2.37.3","v2.37.4","v2.37.5","v2.38.0","v2.38.1","v2.38.2","v2.38.3","v2.39.0","v2.39.1","v2.4.0","v2.4.0-rc0","v2.4.0-rc1","v2.4.0-rc2","v2.4.0-rc3","v2.5.0","v2.5.0-rc0","v2.5.0-rc1","v2.5.0-rc2","v2.5.0-rc3","v2.6.0","v2.6.0-rc0","v2.6.0-rc1","v2.6.0-rc2","v2.6.0-rc3","v2.7.0","v2.7.0-rc0","v2.7.0-rc1","v2.7.0-rc2","v2.7.0-rc3","v2.8.0","v2.8.0-rc0","v2.8.0-rc1","v2.8.0-rc2","v2.8.0-rc3","v2.8.0-rc4","v2.9.0","v2.9.0-rc0","v2.9.0-rc1","v2.9.0-rc2"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-23946.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"}]}