6.5
MEDIUM CVSS 3.1
CVE-2023-41040
GitPython blind local file inclusion
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.

INFO

Published Date :

Aug. 30, 2023, 10:15 p.m.

Last Modified :

Nov. 21, 2024, 8:20 a.m.

Remotely Exploit :

Yes !
Affected Products

The following products are affected by CVE-2023-41040 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Gitpython_project gitpython
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 3.1 MEDIUM [email protected]
CVSS 3.1 MEDIUM [email protected]
Solution
This vulnerability is addressed by updating the GitPython package to a patched version.
  • Update the affected GitPython package.
  • Upgrade the python-git packages.
  • Upgrade python-git-doc packages.
Public PoC/Exploit Available at Github

CVE-2023-41040 has a 1 public PoC/Exploit available at Github. Go to the Public Exploits tab to see the list.

CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2023-41040 is associated with the following CWEs:

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

API interface to the Raindrop Bookmark Manager.

Python Just

Updated: 1 month, 3 weeks ago
37 stars 3 fork 3 watcher
Born at : Dec. 29, 2022, 10:09 p.m. This repo has been linked 16 different CVEs too.

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2023-41040 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2023-41040 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by af854a3a-2127-422b-91ae-364da2661108

    Nov. 21, 2024

    Action Type Old Value New Value
    Added Reference https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175
    Added Reference https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c
    Added Reference https://lists.debian.org/debian-lts-announce/2023/09/msg00036.html
  • CVE Modified by [email protected]

    Sep. 20, 2024

    Action Type Old Value New Value
    Changed 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 not yet been addressed. 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.
    Added Reference GitHub, Inc. https://github.com/gitpython-developers/GitPython/pull/1672 [No types assigned]
    Added Reference GitHub, Inc. https://github.com/gitpython-developers/GitPython/commit/74e55ee4544867e1bd976b7df5a45869ee397b0b [No types assigned]
    Added Reference GitHub, Inc. https://github.com/gitpython-developers/GitPython/commit/e98f57b81f792f0f5e18d33ee658ae395f9aa3c4 [No types assigned]
    Added Reference GitHub, Inc. https://github.com/gitpython-developers/GitPython/releases/tag/3.1.37 [No types assigned]
    Added Reference GitHub, Inc. https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2023-165.yaml [No types assigned]
  • CVE Modified by [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • CVE Modified by [email protected]

    Sep. 29, 2023

    Action Type Old Value New Value
    Added Reference https://lists.debian.org/debian-lts-announce/2023/09/msg00036.html [No Types Assigned]
  • CVE Modified by [email protected]

    Sep. 06, 2023

    Action Type Old Value New Value
    Removed CVSS V3.1 GitHub, Inc. AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
    Added CVSS V3.1 GitHub, Inc. AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
    Removed CVSS V3.1 Reason C-No limiting factors
  • Initial Analysis by [email protected]

    Sep. 05, 2023

    Action Type Old Value New Value
    Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
    Changed Reference Type https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175 No Types Assigned https://github.com/gitpython-developers/GitPython/blob/1c8310d7cae144f74a671cbe17e51f63a830adbf/git/refs/symbolic.py#L174-L175 Product
    Changed Reference Type https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c No Types Assigned https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-cwvm-v4w8-q58c Exploit, Vendor Advisory
    Added CWE NIST CWE-22
    Added CPE Configuration OR *cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:* versions up to (including) 3.1.34
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
Vulnerability Scoring Details
Base CVSS Score: 6.5
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality Impact
Integrity Impact
Availability Impact
Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

0.20 }} -0.02%

score

0.43137

percentile