VDB
Sign up
HIGH7.8

PYSEC-2026-2163

Quick fix

PYSEC-2026-2163 — gitpython: upgrade to the fixed version with the command below.

pip install --upgrade 'gitpython>=3.1.49'

Details

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 indented continuation lines (e.g. \n becomes \n\t), but Git still accepts an indented [core] stanza as a section header — so the injected core.hooksPath becomes effective configuration. Any Git operation that invokes hooks (commit, merge, checkout) will then execute scripts from the attacker-controlled path. This issue has been patched in version 3.1.49.

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/gitpython
Introduced in: 0Fixed in: 3.1.49
Fixpip install --upgrade 'gitpython>=3.1.49'

References