VDB
Sign up
HIGH7.8

PYSEC-2026-3980

Quick fix

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

pip install --upgrade 'gitpython>=3.1.50'

Details

GitPython before 3.1.50 fails to validate newline characters in the section parameter of config_writer(), allowing attackers to inject arbitrary section headers into .git/config. Attackers can inject newlines to create a forged [core] section with hooksPath pointing to attacker-controlled directories, achieving remote code execution when git hooks are triggered.

Are you affected?

Enter the version of the package you're using.

Affected packages

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

References