# CVE-2026-52726: Dulwich's submodule path traversal in porcelain.submodule_update / porcelain.clone(recurse_submodules=True) yields RCE via attacker-dropped .git/hooks payload

> Attackers can achieve remote code execution by crafting a repository with malicious submodule paths that write executable hooks into the victim's .git directory.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Jun 2026
- **Updated:** 11 Jun 2026
- **Also known as:** CLEANSTART-2026-XF61795, CLSA-2026-1783299701, DEBIAN-CVE-2026-52726, ECHO-fc0e-ca5a-02ac, GHSA-gfhv-vqv2-4544, MINI-ppgj-42ph-g88g, PYSEC-2026-2465, ROOT-APP-PYPI-CVE-2026-52726, UBUNTU-CVE-2026-52726

## What is CVE-2026-52726?

CVE-2026-52726 is a high-severity path traversal vulnerability in jelmer dulwich, published on 10 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Dulwich is a pure-Python implementation of the Git file formats and protocols. Starting in version 0.23.2 and prior to version 1.2.5, `dulwich.porcelain.submodule_update`, and by extension `porcelain.clone(..., recurse_submodules=True)`, materializes attacker-controlled submodule paths from a crafted upstream repository without path validation. A malicious `.gitmodules` plus a matching tree gitlink whose `path` is `.git/hooks` (or any other directory inside the parent repository's `.git` directory) causes the attacker's submodule tree contents to be written directly into the victim's `.git/hooks/` directory, preserving executable mode bits. The dropped executables are then run by any subsequent `git` or `dulwich` command that invokes the matching hook, resulting in arbitrary code execution. This is the dulwich equivalent of the upstream Git fixes for CVE-2024-32002 / CVE-2024-32004, which were never propagated into dulwich's separately implemented submodule porcelain. Version 1.2.5 patches the issue.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

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

3 open source packages ship an affected version, including dulwich.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `dulwich` | PyPI | From 0.23.2 | 1.2.5 |
| `dulwich` | PyPI | From 0.23.2 | 1.2.5 |
| `dulwich` | PyPI | From 0.23.2 | 1.2.5 |

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

Upgrade dulwich to 1.2.5 or later.

## Is CVE-2026-52726 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-52726 is a high-severity path traversal vulnerability in jelmer dulwich, published on 10 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-52726 exists.

Affected packages and fixed versions:
- dulwich (PyPI): affected from 0.23.2; fixed in 1.2.5
- dulwich (PyPI): affected from 0.23.2; fixed in 1.2.5
- dulwich (PyPI): affected from 0.23.2; fixed in 1.2.5

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-52726/ (Markdown: https://insights.sbomify.com/CVE-2026-52726/index.md)
```

## Sources

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

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