6.5
MEDIUM
CVE-2023-41040
GitPython Denial of Service File Path Manipulation Vulnerability
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 :

Sept. 20, 2024, 9:15 p.m.

Remotely Exploitable :

Yes !

Impact Score :

2.5

Exploitability Score :

3.9
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.

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

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: 4 weeks, 2 days ago
23 stars 0 fork 0 watcher
Born at : Dec. 29, 2022, 10:09 p.m. This repo has been linked 7 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 [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.
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:

Exploit Prediction

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

0.27 }} 0.18%

score

0.68273

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability