CVE-2023-41040

Publication date 30 August 2023

Last updated 6 June 2026


Ubuntu priority

Cvss 3 Severity Score

4.0 · Medium

Score breakdown

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.

Status

Package Ubuntu Release Status
python-git 26.04 LTS resolute
Not affected
25.10 questing
Not affected
25.04 plucky Ignored end of life, was needs-triage
24.10 oracular Ignored end of life, was needs-triage
24.04 LTS noble
Not affected
23.10 mantic Ignored end of life, was needs-triage
23.04 lunar Ignored end of life, was needs-triage
22.04 LTS jammy
Fixed 3.1.24-1ubuntu0.1~esm3
20.04 LTS focal
Fixed 3.0.7-1ubuntu0.1~esm4
18.04 LTS bionic
Fixed 2.1.8-1ubuntu0.1~esm4
16.04 LTS xenial Ignored end of standard support
14.04 LTS trusty
Fixed 0.3.2~RC1-3ubuntu0.1~esm3

Get expanded security coverage with Ubuntu Pro

Reduce your average CVE exposure time from 98 days to 1 day with expanded CVE patching, ten-years security maintenance and optional support for the full stack of open-source applications. Free for personal use.

Get Ubuntu Pro 30-day free trial

Patch details

For informational purposes only. We recommend not to cherry-pick updates. How can I get the fixes?

Package Patch details
python-git

Severity score breakdown

Parameter Value
Base score 4.0 · Medium
Attack vector Local
Attack complexity Low
Privileges required None
User interaction None
Scope Unchanged
Confidentiality None
Integrity impact None
Availability impact Low
Vector CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Access our resources on patching vulnerabilities