CVE-2026-67326 is a high severity (CVSS 7.0) input validation flaw in GitPython. Versions up to 3.1.49 do not check newlines in the section argument of config_writer, so an attacker who controls it can inject config sections. Upgrade to GitPython 3.1.50 or later.
What's affected
The record says GitPython before 3.1.50 is affected. The GitHub advisory (GHSA-mv93-w799-cj2w) lists affected versions as 3.1.49 and earlier and the patched version as 3.1.50. The two sources agree, and both rate it High.
The advisory frames this as a bypass of the fix for an earlier CVE (CVE-2026-42215). That earlier patch, shipped in 3.1.49, validated newlines in the value argument of set_value, but the section and option arguments still went to the config parser unchecked.
The weakness only matters if untrusted data can reach the section argument of config_writer. That is an application design question, not a flaw in every program that imports GitPython.
How to check if you're exposed
pip show gitpython
pip freeze | grep -i gitpython
Run these inside each virtual environment and container image you ship, because the system Python and the application environment are often different.
Then check how your code calls the config writer:
grep -rn "config_writer" .
For each call, trace where the section name comes from. A constant in your source is fine. A value taken from a repository name, a request, a file or a user form is the case to fix. Check CI runners and build tools too, since GitPython often sits inside tooling that handles repositories you do not own.
A quicker route for a whole project is the free in-browser dependency scan at Gold. Paste a manifest or lockfile and it matches each dependency against known CVEs, including ones pulled in indirectly.
What to do now
- Upgrade GitPython to 3.1.50 or later. Later releases also close a related issue, see the 3.1.53 note below.
- Audit every call to config_writer and note where its section argument comes from.
- Reject newlines and other control characters in any value you pass as a config section or option name.
- Make sure tooling that runs git hooks on cloned repositories runs in a sandbox with limited permissions.
- Do not stop at 3.1.50. A separate section name injection, CVE-2026-69097, is fixed in 3.1.53.
Reachability analysis helps with ordering the work. Knowing whether your code actually calls the affected path tells you which services to patch first.
Why it matters
The class is CWE-20, improper input validation. The record describes how the injected text could create a forged core section pointing the hooks path at a directory the attacker controls, so that git runs attacker-chosen scripts the next time a hook fires. That turns a file write into code execution.
The pattern is common. A previous fix checked one parameter, and the same hole stayed open on the neighbouring ones. When a patch covers one argument of a function, check the others. The record does not mark this CVE as known exploited.
Try it yourself
GitPython is often a transitive dependency of build and automation tools. This demo shows how an inventory surfaces where it sits.
Click through it at your own pace, or open it full screen.
Quick check
Does every GitPython user have to worry?
Only code that lets untrusted input reach the section argument of config_writer is exposed, but upgrading is cheap and the version range is clear.
Is 3.1.50 the last fix I need?
No. CVE-2026-69097 is fixed in 3.1.53, so aim for that or later.
Sources
- https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-mv93-w799-cj2w
- Record: NVD entry for CVE-2026-67326 (score 7.0, HIGH)
Last reviewed: 18 October 2026.