{"id":"CVE-2023-41040","published":"2023-08-30T21:07:42Z","modified":"2025-11-03T21:49:29Z","title":"GitPython blind local file inclusion","vendor":"gitpython-developers","product":"GitPython","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01054,"percentile":0.63758,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/gitpython-developers/GitPython/pull/1672","tags":["x_refsource_MISC"]},{"url":"https://github.com/gitpython-developers/GitPython/commit/74e55ee4544867e1bd976b7df5a45869ee397b0b","tags":["x_refsource_MISC"]},{"url":"https://github.com/gitpython-developers/GitPython/commit/e98f57b81f792f0f5e18d33ee658ae395f9aa3c4","tags":["x_refsource_MISC"]},{"url":"https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175","tags":["x_refsource_MISC"]},{"url":"https://github.com/gitpython-developers/GitPython/releases/tag/3.1.37","tags":["x_refsource_MISC"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2023-165.yaml","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/09/msg00036.html","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/10/msg00030.html","tags":[]}],"priority":{"score":15.6,"factors":[{"name":"EPSS percentile","points":12.75},{"name":"CVSS severity","points":2.8}]},"vendorSlug":"gitpython-developers","affectedVersions":[{"vendor":"gitpython-developers","product":"GitPython","versions":["< 3.1.37"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2024-10-01T18:04:46.833039Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"GitPython","vulnerableRanges":["<3.1.37","<3.1.35"],"patched":["3.1.37","3.1.35"],"from":["GHSA-cwvm-v4w8-q58c","PYSEC-2023-165"],"provenance":"source"}],"summary":{"text":"GitPython, a Python library for interacting with Git repositories, contains a path traversal flaw in its symbolic reference handling (git/refs/symbolic.py), where a user-supplied filename is joined to the .git directory without verifying that the resulting path stays inside it. An attacker with local access and no privileges, and requiring no user interaction, can cause the library to reference files outside the .git directory, though this cannot be used to read file contents and the realistic impact is limited to a possible denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:31:35Z"},"euvd":{"id":"EUVD-2023-0087","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2022-24439","published":"2022-12-12","fixed":"3.1.30","kev":false},{"cve":"CVE-2023-40267","published":"2023-08-11","fixed":"3.1.32","kev":false},{"cve":"CVE-2023-40590","published":"2023-08-28","fixed":"3.1.33","kev":false,"link":{"from":"CVE-2023-40590","to":"CVE-2023-41040","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:GitPython","fromFixed":"3.1.33","toFixed":"3.1.37","daysApart":2}]}},{"cve":"CVE-2023-41040","published":"2023-08-30","fixed":"3.1.37","kev":false},{"cve":"CVE-2024-22190","published":"2024-01-11","fixed":"3.1.41","kev":false,"link":{"from":"CVE-2023-41040","to":"CVE-2024-22190","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:GitPython","fromFixed":"3.1.37","toFixed":"3.1.41","daysApart":134}]}},{"cve":"CVE-2026-42215","published":"2026-05-07","fixed":"3.1.47","kev":false},{"cve":"CVE-2026-42284","published":"2026-05-07","fixed":"3.1.47","kev":false}],"package":"PyPI:GitPython"}}