# CVE-2026-42563: Dulwich OS command injection in ProcessMergeDriver

Source: https://junglewise.ai/threats/cve-2026-42563-dulwich-os-command-injection-in-processmergedriver  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-10. Updated: 2026-06-10  
License: CC BY 4.0 with a link back

CVE-2026-42563 · Severity: high · CVSS 4 · Published 2026-06-10

Dulwich is a Python library used to interact with Git repositories. A security flaw allows an attacker to execute malicious commands on a user's computer if the user is tricked into merging a specially crafted, untrusted branch. This could lead to a full system compromise, data theft, or unauthorized access to the user's files.

Technologies: [dulwich (PyPI)](https://junglewise.ai/threats/technologies/dulwich). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-42563 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-42563 being exploited in the wild.

**How severe is CVE-2026-42563?** High severity, with a CVSS score of 4, published 10 June 2026.

**Which products and versions are affected?** dulwich (PyPI) >= 0.24.0, < 1.2.5, ECOSYSTEM:introduced=0.24.0,fixed=1.2.5.

**Is there a fix for CVE-2026-42563?** Yes. dulwich (PyPI): upgrade to 1.2.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-42563 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-42563?** Check whether you run dulwich (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- dulwich (PyPI): upgrade to 1.2.5 or later

  ```sh
  pip install "dulwich>=1.2.5"
  ```


## Technical details

A command injection vulnerability exists in Dulwich's `ProcessMergeDriver` due to improper neutralization of shell metacharacters. The component substitutes the file path (placeholder `%P`) from the Git tree directly into a command string executed via `subprocess.run(..., shell=True)`. Because file paths in a Git tree can be controlled by an attacker in a malicious branch, they can inject shell commands (e.g., using semicolons or backticks). Exploitation requires the victim to have a merge driver configured that utilizes the `%P` placeholder and to perform a merge operation on an untrusted branch. The issue is fixed in version 1.2.5 by properly shell-quoting substituted values.

## Affected products

- Jelmer Vernooĳ Dulwich >=0.24.0, <1.2.5

## Identifiers

- CVE-2026-42563
- GHSA-9277-mp7x-85jf
- PYSEC-2026-2464

## Timeline

- 2026-05-28: patched: Fixed in version 1.2.5
- 2026-05-28: advisory: GitHub Security Advisory GHSA-9277-mp7x-85jf published
- 2026-06-10: disclosed: CVE-2026-42563 published to NVD

## References

- [https://github.com/jelmer/dulwich/commit/e3331b3b3a122fc313460182f928f59723580b7b](https://github.com/jelmer/dulwich/commit/e3331b3b3a122fc313460182f928f59723580b7b)
- [https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5](https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5)
- [https://github.com/jelmer/dulwich/security/advisories/GHSA-9277-mp7x-85jf](https://github.com/jelmer/dulwich/security/advisories/GHSA-9277-mp7x-85jf)

## Related threats

- [Dulwich arbitrary file write on Windows via unvalidated drive letters](https://junglewise.ai/threats/dulwich-arbitrary-file-write-rce-on-windows-via-unvalidated-drive-fc90311d)
- [Dulwich infinite loop denial of service in packfile object resolution](https://junglewise.ai/threats/dulwich-infinite-loop-denial-of-service-dos-in-packfile-object-d71acec7)
- [Dulwich symlink write-through in checkout via os.open](https://junglewise.ai/threats/dulwich-symlink-write-through-in-checkout-paths-via-raw-os-open-7e9ebad6)
- [Dulwich symlink directory traversal in filter-branch index_filter](https://junglewise.ai/threats/dulwich-symlink-directory-traversal-in-filter-branch-index-filter-via-c34daf58)
- [Dulwich symlink directory traversal in stash pop](https://junglewise.ai/threats/dulwich-symlink-directory-traversal-in-stash-pop-allows-arbitrary-file-12378d39)
