# CVE-2026-40034: gitoxide - Command Injection via Partial .gitmodules Override in gix-submodule

> Attackers can execute arbitrary shell commands via malicious .gitmodules configuration in gix-submodule, leading to remote code execution.

- **Severity:** High 7.3 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 26 May 2026
- **Updated:** 8 Oct 2026
- **Also known as:** AZL-89292, AZL-89295, DEBIAN-CVE-2026-40034, GHSA-f26g-jm89-4g65, MINI-q664-jrjx-6mhj, UBUNTU-CVE-2026-40034, openSUSE-SU-2026:11038-1, openSUSE-SU-2026:12338-1, openSUSE-SU-2026:21185-1

## What is CVE-2026-40034?

CVE-2026-40034 is a high-severity command injection vulnerability in gitoxide, published on 26 May 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

gix-submodule before 0.29.0 (gitoxide before 0.5.21, gix before 0.84.0) incorrectly validates the update field in .gitmodules, allowing attackers to bypass the CommandForbiddenInModulesConfiguration guard when a submodule has been initialized with only partial configuration in .git/config. An attacker can inject arbitrary shell commands via the update field in .gitmodules that will be executed when Submodule::update() is called on a previously-initialized submodule, enabling remote code execution.

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2026-40034?

2 open source packages ship an affected version, including gix.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gix` | crates.io | From 0.31.0 | 0.83.0 |
| `gix` | crates.io | From 0.31.0 | 0.83.0 |
| `stgit` | openSUSE:Leap 16.0 | All versions | 2.6.0-bp160.1.1 |
| `stgit` | openSUSE:Tumbleweed | All versions | 2.6.0-1.1 |
| `watchexec` | openSUSE:Tumbleweed | All versions | 2.8.0-1.1 |

## How do I fix CVE-2026-40034?

Upgrade gix to 0.83.0 or later.

## Is CVE-2026-40034 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40034 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40034 and fix it if it is affected.

What it is: CVE-2026-40034 is a high-severity command injection vulnerability in gitoxide, published on 26 May 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40034 exists.

Affected packages and fixed versions:
- gix (crates.io): affected from 0.31.0; fixed in 0.83.0
- gix (crates.io): affected from 0.31.0; fixed in 0.83.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-40034/ (Markdown: https://insights.sbomify.com/CVE-2026-40034/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-40034
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-40034
- OSV: https://osv.dev/vulnerability/CVE-2026-40034

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-40034/
Summaries are generated and may contain mistakes; the official description above is the record.
