Safeguard
Vulnerability Analysis•

CVE-2026-69097: High Config Injection in GitPython Submodule Names

GitPython up to 3.1.52 does not escape section names in git config, so a malicious submodule name can inject core.sshCommand. Upgrade to 3.1.53.

Safeguard Security Team
3 min read

CVE-2026-69097 is a high severity (CVSS 7.0) injection flaw in GitPython. Versions up to 3.1.52 do not properly escape section names written to git config, so a hostile submodule name can add dangerous settings such as core.sshCommand. Upgrade to GitPython 3.1.53 or later.

What's affected

The record says GitPython before 3.1.53 is affected. The GitHub advisory (GHSA-3rp5-jjmw-4wv2) lists 3.1.52 and earlier as affected and 3.1.53 as patched. The sources agree, and both rate it High.

The advisory explains that the config writer only neutralized carriage return, line feed and NUL in configuration names. Other characters that close a section header, such as a closing bracket followed by an opening one, passed through. That means no newline is needed to inject a second section.

The operations named in the record are create_submodule and clone_from. A submodule name is data from the repository, so the advisory treats it as attacker controlled when you handle repositories from outside your organisation.

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 find where your code handles submodules and clones:

grep -rn "create_submodule\|clone_from\|submodule" .

Services that clone third party repositories are the priority: code review bots, mirroring jobs, CI helpers, dependency analysis tools. If you only handle repositories you wrote yourself, the practical risk is lower, though the fix is still worth taking.

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

  1. Upgrade GitPython to 3.1.53 or later.
  2. List every service that clones or creates submodules from repositories you do not control.
  3. Run those services without access to long lived credentials or an SSH agent, since the record describes the outcome as code execution when git performs ssh operations.
  4. Check for unexpected sshCommand or hooks settings in .git/config of existing checkouts.
  5. Also review CVE-2026-67326, an earlier config writer injection fixed in 3.1.50.

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 weakness is CWE-74, injection into a downstream interpreter. Here the downstream component is the git config parser. Data that is supposed to be a name gets written inside a bracketed header, and if the name can close the header, the rest of it becomes new configuration.

The consequence in the record is remote code execution, because git configuration can name programs to run for ssh. Defence belongs on both sides: escape names at the writer, and treat repository metadata from outside your trust boundary as hostile. The record does not mark this CVE as known exploited.

Quick check

Is a newline required for this injection?

The advisory says no. Characters that close and reopen a section header are enough, which is why the earlier newline fix did not stop it.

Which versions are fixed?

3.1.53 and later, per the advisory and the record.

Sources

Last reviewed: 18 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.