{"cve":"CVE-2023-41040","nvd":{"published":"2023-08-30T22:15:09.857","modified":"2026-06-17T06:20:14.253","status":"Modified","description":"GitPython is a python library used to interact with Git repositories. In order to resolve some git references, GitPython reads files from the `.git` directory, in some places the name of the file being read is provided by the user, GitPython doesn't check if this file is located outside the `.git` directory. This allows an attacker to make GitPython read any file from the system. This vulnerability is present in https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175. That code joins the base directory with a user given string without checking if the final path is located outside the base directory. This vulnerability cannot be used to read the contents of files but could in theory be used to trigger a denial of service for the program. This issue has been addressed in version 3.1.37.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","score":6.5},"cwes":["CWE-22"],"references":["https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175","https://github.com/gitpython-developers/GitPython/commit/74e55ee4544867e1bd976b7df5a45869ee397b0b","https://github.com/gitpython-developers/GitPython/commit/e98f57b81f792f0f5e18d33ee658ae395f9aa3c4","https://github.com/gitpython-developers/GitPython/pull/1672","https://github.com/gitpython-developers/GitPython/releases/tag/3.1.37"],"products":["gitpython_project:gitpython"],"source":"nvd","synced_at":"2026-10-19T21:39:14.809778102+00:00"},"epss":{"cve":"CVE-2023-41040","score":0.01093,"percentile":0.65442,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-cwvm-v4w8-q58c","url":"https://osv.dev/vulnerability/GHSA-cwvm-v4w8-q58c","summary":"GitPython blind local file inclusion","modified":"2025-11-04T16:49:25.840497Z","packages":[{"ecosystem":"PyPI","name":"gitpython","purl":"pkg:pypi/gitpython","ranges":["<3.1.37"],"fixed":["3.1.37"]}]},{"id":"PYSEC-2023-165","url":"https://osv.dev/vulnerability/PYSEC-2023-165","summary":"","modified":"2023-11-08T04:13:23.455909Z","packages":[{"ecosystem":"PyPI","name":"gitpython","purl":"pkg:pypi/gitpython","ranges":["<3.1.35"],"fixed":["3.1.35"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}