Skip to content
OpenAdvisories
High USN-8303-1 5 CVEs

python-git vulnerabilities

Published May 26, 2026 · Updated May 27, 2026

Summary

Santos Gallegos discovered that GitPython did not properly validate
paths when resolving certain Git references. An attacker could possibly
use this issue to cause files outside the .git directory to be accessed,
leading to a denial of service. This issue only affected Ubuntu 14.04
LTS, Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, and Ubuntu
22.04 LTS. (CVE-2023-41040)

Wes Ring discovered that GitPython did not properly block certain unsafe
Git options when they were provided as Python keyword arguments. An
attacker could possibly use this issue to cause arbitrary command
execution. (CVE-2026-42215)

It was discovered that GitPython did not properly validate clone options
before processing them. An attacker could possibly use this issue to
inject unsafe Git configuration, leading to arbitrary command execution
through Git hooks. This issue only affected Ubuntu 20.04 LTS, Ubuntu
22.04 LTS, Ubuntu 24.04 LTS, and Ubuntu 26.04 LTS. (CVE-2026-42284)

It was discovered that GitPython did not properly validate reference
paths during reference operations. An attacker could possibly use this
issue to write, overwrite, move, or delete files outside the repository.
(CVE-2026-44243)

Dan Aridor discovered that GitPython did not properly validate
configuration values before writing them to Git configuration files. An
attacker could possibly use this issue to inject unsafe Git
configuration, leading to arbitrary command execution through Git hooks.
(CVE-2026-44244)

Fixed packages 7

ReleasePackageFixed in
Ubuntu · Pro 14.04 LTS Pro:14.04:LTS python-git 0.3.2~RC1-3ubuntu0.1~esm3
Ubuntu · Pro 16.04 LTS Pro:16.04:LTS python-git 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4
Ubuntu · Pro 18.04 LTS Pro:18.04:LTS python-git 2.1.8-1ubuntu0.1~esm4
Ubuntu · Pro 20.04 LTS Pro:20.04:LTS python-git 3.0.7-1ubuntu0.1~esm4
Ubuntu · Pro 22.04 LTS Pro:22.04:LTS python-git 3.1.24-1ubuntu0.1~esm3
Ubuntu · Pro 24.04 LTS Pro:24.04:LTS python-git 3.1.37-3ubuntu0.1~esm2
Ubuntu · Pro 26.04 LTS Pro:26.04:LTS python-git 3.1.46-1ubuntu0.1~esm1

Vulnerabilities 5

  • High 8.8

    GitPython: Command injection via Git options bypass

    GitPython is a python library used to interact with Git repositories. From version 3.1.30 to before version 3.1.47, GitPython blocks dangerous Git options such as --upload-pack and --receive-pack by default, but the equivalent Python kwargs upload_pack and re…

  • High 8.1

    GitPython: Unsafe option check validates multi_options before shlex.split transforms it

    GitPython is a python library used to interact with Git repositories. Prior to version 3.1.47, _clone() validates multi_options as the original list, then executes shlex.split(" ".join(multi_options)). A string like "--branch main --config core.hooksPath=/x" …

  • High 7.8

    GitPython: Path traversal in GitPython reference APIs allows arbitrary file write and delete outside the repository

    GitPython is a python library used to interact with Git repositories. Prior to version 3.1.48, a vulnerability in GitPython allows attackers who can supply a crafted reference path to an application using GitPython to write, overwrite, move, or delete files o…

  • High 7.8

    GitPython: Newline injection in config_writer().set_value() enables RCE via core.hooksPath

    GitPython is a python library used to interact with Git repositories. Prior to version 3.1.49, GitConfigParser.set_value() passes values to Python's configparser without validating for newlines. GitPython's own _write() converts embedded newlines into indente…

  • Medium 4.0

    GitPython blind local file inclusion

    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 …

References

  • report
    https://ubuntu.com/security/CVE-2023-41040
  • report
    https://ubuntu.com/security/CVE-2026-42215
  • report
    https://ubuntu.com/security/CVE-2026-42284
  • report
    https://ubuntu.com/security/CVE-2026-44243
  • report
    https://ubuntu.com/security/CVE-2026-44244