Skip to main content
MEDIUM

CVE-2023-41040

CVSS v3

6.5

MEDIUM

EPSS Score

1.1 %

exploit probability, as of 2026-10-17

CISA KEV

No

known exploited

Exploitation

—

SSVC status

Get an alert for each new CVE published for gitpython. Watch gitpython in CVE Watch Free account · no credit card

Affected and fixed versions

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • gitpythonPyPIall versions · fixed in 3.1.35

Vendor advisories

  • CVE-2023-41040 Red Hat Product Security18 products fixed · 5 known affected

    GitPython: Blind local file inclusion

    redhat-certification.src as a component of Red Hat Certification for Red Hat Enterprise Linux 7 · redhat-certification.src as a component of Red Hat Certification for Red Hat Enterprise Linux 8 · redhat-certification.src as a component of Red Hat Certification Program for Red Hat Enterprise Linux 9

  • RHSA-2024:1640 Red Hat Product Security8 products fixed

    Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update

  • RHSA-2024:0322 Red Hat Product Security4 products fixed

    Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update

  • RHSA-2024:0190 Red Hat Product Security2 products fixed

    Red Hat Security Advisory: Red Hat OpenStack Platform 17.1 (GitPython) security update

  • RHSA-2024:0215 Red Hat Product Security2 products fixed

    Red Hat Security Advisory: Red Hat OpenStack Platform 17.1 (GitPython) security update

  • RHSA-2023:7851 Red Hat Product Security2 products fixed

    Red Hat Security Advisory: Satellite 6.14.1 Async Security Update

Full record on NVD

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.

Technical details

Published
2023-08-30

Frequently asked questions

What is CVE-2023-41040?

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.

Is CVE-2023-41040 actively exploited?

Active exploitation of CVE-2023-41040 has not been confirmed. Its EPSS score was 1.1% on 2026-10-17, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2023-41040?

CVE-2023-41040 has a CVSS v3 base score of 6.5 (MEDIUM severity).

Running gitpython? Hear about its next vulnerability

CVE Watch matches each new CVE to the vendors and products you list (vendor and product, not the version) and puts it in your alerts with its KEV and EPSS status.

Already have an account? Open CVE WatchNo credit card required · 50 free checks/month · Free API key