{"answers":{"affected":"3 open source packages ship an affected version, including gitpython and GitPython. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-41040 exists.","fix":"Upgrade gitpython to a fixed version for your release line: 3.1.35 or 3.1.37.","what":"CVE-2023-41040 is a medium-severity path traversal vulnerability in gitpython-developers GitPython, published on 30 Aug 2023. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-41040 and fix it if it is affected.\n\nWhat it is: CVE-2023-41040 is a medium-severity path traversal vulnerability in gitpython-developers GitPython, published on 30 Aug 2023. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-41040 exists.\n\nAffected packages and fixed versions:\n- gitpython (PyPI): affected all versions; fixed in 3.1.35\n- gitpython (PyPI): affected all versions; fixed in 3.1.37\n- GitPython (PyPI): affected all versions; fixed in 3.1.37\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-41040/ (Markdown: https://insights.sbomify.com/CVE-2023-41040/index.md)","id":"CVE-2023-41040","markdown":"https://insights.sbomify.com/CVE-2023-41040/index.md","name":"CVE-2023-41040","record":{"aliases":["CLSA-2025-1759191117","DEBIAN-CVE-2023-41040","DLA-3589-1","GHSA-cwvm-v4w8-q58c","OESA-2023-1628","PYSEC-2023-165","RHSA-2024:0190","RHSA-2024:0215","UBUNTU-CVE-2023-41040","openSUSE-SU-2023:0259-1","openSUSE-SU-2023:0271-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"GitPython library","requires_auth":"none","summary":"An attacker can trigger a denial of service in GitPython by exploiting a path traversal vulnerability that allows reading files outside the .git directory.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"gitpython","vendor":"gitpython_project"}],"cvss":{"score":4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"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.","ecosystems":["PyPI","Red Hat:openstack:17.1::el8","Red Hat:openstack:17.1::el9","SUSE:Package Hub 15 SP4","SUSE:Package Hub 15 SP5","openSUSE:Leap 15.4","openSUSE:Leap 15.5"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"GitPython blind local file inclusion","id":"CVE-2023-41040","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"path_traversal","year":"2023"},"n_packages":11,"n_references":8,"next":{"headline":"User session is still usable after logout in graylog2-server","id":"CVE-2023-41041"},"packages":[{"ecosystem":"PyPI","fixed":["3.1.37"],"introduced":["0"],"last_affected":[],"package":"GitPython","purl":null,"source":"GHSA-cwvm-v4w8-q58c"},{"ecosystem":"PyPI","fixed":["3.1.35"],"introduced":["0"],"last_affected":[],"package":"gitpython","purl":"pkg:pypi/gitpython","source":"PYSEC-2023-165"},{"ecosystem":"PyPI","fixed":["3.1.37"],"introduced":["0"],"last_affected":[],"package":"gitpython","purl":"pkg:pypi/gitpython","source":"GHSA-cwvm-v4w8-q58c"},{"ecosystem":"Red Hat:openstack:17.1::el8","fixed":["0:3.1.14-2.el8ost"],"introduced":["0"],"last_affected":[],"package":"GitPython","purl":"pkg:rpm/redhat/GitPython","source":"RHSA-2024:0190"},{"ecosystem":"Red Hat:openstack:17.1::el8","fixed":["0:3.1.14-2.el8ost"],"introduced":["0"],"last_affected":[],"package":"python3-GitPython","purl":"pkg:rpm/redhat/python3-GitPython","source":"RHSA-2024:0190"},{"ecosystem":"Red Hat:openstack:17.1::el9","fixed":["0:3.1.14-2.el9ost"],"introduced":["0"],"last_affected":[],"package":"GitPython","purl":"pkg:rpm/redhat/GitPython","source":"RHSA-2024:0215"},{"ecosystem":"Red Hat:openstack:17.1::el9","fixed":["0:3.1.14-2.el9ost"],"introduced":["0"],"last_affected":[],"package":"python3-GitPython","purl":"pkg:rpm/redhat/python3-GitPython","source":"RHSA-2024:0215"},{"ecosystem":"SUSE:Package Hub 15 SP4","fixed":["3.1.12.1610074031.f653af66-bp154.2.3.1"],"introduced":["0"],"last_affected":[],"package":"python-GitPython","purl":"pkg:rpm/suse/python-GitPython\u0026distro=SUSE%20Package%20Hub%2015%20SP4","source":"openSUSE-SU-2023:0271-1"},{"ecosystem":"SUSE:Package Hub 15 SP5","fixed":["3.1.12.1610074031.f653af66-bp155.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-GitPython","purl":"pkg:rpm/suse/python-GitPython\u0026distro=SUSE%20Package%20Hub%2015%20SP5","source":"openSUSE-SU-2023:0259-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["3.1.12.1610074031.f653af66-bp154.2.3.1"],"introduced":["0"],"last_affected":[],"package":"python-GitPython","purl":"pkg:rpm/opensuse/python-GitPython\u0026distro=openSUSE%20Leap%2015.4","source":"openSUSE-SU-2023:0271-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["3.1.12.1610074031.f653af66-bp155.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-GitPython","purl":"pkg:rpm/opensuse/python-GitPython\u0026distro=openSUSE%20Leap%2015.5","source":"openSUSE-SU-2023:0259-1"}],"prev":{"headline":"Sandbox escape via various forms of \"format\" in RestrictedPython","id":"CVE-2023-41039"},"products":["GitPython"],"published":"2023-08-30","related":[{"cvss_score":9.8,"headline":"GitPython vulnerable to remote code execution due to insufficient sanitization of input arguments","id":"CVE-2023-40267","kev_date_added":null,"published":"2023-08-11"},{"cvss_score":9.3,"headline":"GitPython before 3.1.59 Remote Code Execution via Config Injection","id":"CVE-2026-78676","kev_date_added":null,"published":"2026-08-25"},{"cvss_score":9.3,"headline":"GitPython 3.1.50 Authentication Bypass via Joined Short Options","id":"CVE-2026-67324","kev_date_added":null,"published":"2026-08-01"},{"cvss_score":8.8,"headline":"GitPython: Command injection via Git options bypass","id":"CVE-2026-42215","kev_date_added":null,"published":"2026-05-07"},{"cvss_score":8.7,"headline":"GitPython before 3.1.60 Remote Code Execution via Git Directory Impersonation","id":"CVE-2026-87817","kev_date_added":null,"published":"2026-09-09"},{"cvss_score":8.7,"headline":"GitPython before 3.1.60 Denial of Service via ReDoS","id":"CVE-2026-87819","kev_date_added":null,"published":"2026-09-09"},{"cvss_score":8.7,"headline":"GitPython before 3.1.59 Path Traversal via separate-git-dir","id":"CVE-2026-78677","kev_date_added":null,"published":"2026-08-25"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-11-03","vendors":["gitpython-developers"]},"summary":"An attacker can trigger a denial of service in GitPython by exploiting a path traversal vulnerability that allows reading files outside the .git directory.","url":"https://insights.sbomify.com/CVE-2023-41040/"}