# CVE-2026-42563: Dulwich Vulnerable to Command Injection via Merge Driver Path

> Attackers can execute arbitrary commands by tricking users into merging malicious branches containing crafted file paths in Dulwich.

- **Severity:** High 7.7 (`CVSS:4.0/AV:N/AC:L/AT:P/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:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 10 Jun 2026
- **Updated:** 12 Jun 2026
- **Also known as:** CLEANSTART-2026-MJ32285, CLSA-2026-1781052734, DEBIAN-CVE-2026-42563, ECHO-b3a3-3b48-f3fe, GHSA-9277-mp7x-85jf, MINI-2p86-fr3m-g34v, PYSEC-2026-2464, ROOT-APP-PYPI-CVE-2026-42563, UBUNTU-CVE-2026-42563

## What is CVE-2026-42563?

CVE-2026-42563 is a high-severity command injection vulnerability in jelmer dulwich, published on 10 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Dulwich is a pure-Python implementation of the Git file formats and protocols. Starting in version 0.24.0 and prior to version 1.2.5, Dulwich's `ProcessMergeDriver` substitutes the file path (from the git tree, controllable by an attacker via a malicious branch) into the merge driver command via the `%P` placeholder and executes it with `subprocess.run(..., shell=True)`. An attacker who can cause a victim to merge an untrusted branch can achieve arbitrary command execution by crafting malicious file paths. Version 1.2.5 fixes the issue.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

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

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


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

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

Upgrade dulwich to 1.2.5 or later.

## Is CVE-2026-42563 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-42563 is a high-severity command injection vulnerability in jelmer dulwich, published on 10 Jun 2026. An attacker can exploit it over the internet without logging in, 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-42563 exists.

Affected packages and fixed versions:
- dulwich (PyPI): affected from 0.24.0; fixed in 1.2.5
- dulwich (PyPI): affected from 0.24.0; fixed in 1.2.5
- dulwich (PyPI): affected from 0.24.0; 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-42563/ (Markdown: https://insights.sbomify.com/CVE-2026-42563/index.md)
```

## Sources

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

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