CVE-2026-122299

Dulwich before 1.2.20 Commit Parser Tree Header Misinterpretation

Published Nov 4, 2026 CVSS 4.0 · 8.6 High EPSS < 1% KEV · Not listed
Description
Dulwich before 1.2.20 contains a commit object parsing vulnerability where the read path in _parse_commit resolves a duplicate tree header to the last occurrence instead of the first, diverging from core git's resolution behavior, while Poetry 2.5.1 ships this version and uses dulwich by default for git dependency installation. Attackers can craft a commit object with two tree headers so that reviewers and CI using git see a benign tree while Poetry's dulwich-based checkout resolves to a different attacker-controlled tree containing malicious build scripts such as setup.py, resulting in unreviewed code execution on the install or build host.

Analysis

AI-generated

Technical impact

Dulwich, a pure‑Python implementation of Git, parses commit objects by examining the tree header section. In versions older than 1.2.20 the parser incorrectly selects the last of any duplicate tree headers rather than the first, diverging from core Git’s behavior. An attacker can craft a commit that contains two tree headers: the first points to a benign tree that normal Git tools display, while the second points to a malicious tree that includes build scripts such as setup.py. When the vulnerable Dulwich instance is used – for example, by Poetry during dependency installation – the second tree is checked out and the embedded scripts execute, giving the attacker arbitrary code execution on the build or install host.

Affected Systems

All installations of Dulwich from vendor jelmer that are older than version 1.2.20 are affected. Poetry 2.5.1 ships this version and uses Dulwich by default for Git dependency installation. Earlier Poetry versions may also bundle the vulnerable Dulwich code, but that is inferred from the description and not explicitly confirmed.

Risk and Exploitability

The issue carries a CVSS score of 8.6, indicating high severity, and is not listed in the CISA KEV catalog. The EPSS score is not available. Because Poetry automatically invokes Dulwich, an attacker who can supply or manipulate the contents of a repository can exploit this flaw from either a remote or local context – the likely attack vector is the delivery of a malicious repository that contains a crafted commit with duplicate tree headers. Successful exploitation results in unreviewed execution of arbitrary code on the host performing the Poetry install, potentially compromising the entire system.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Dulwich to version 1.2.20 or later.
  • Upgrade Poetry to the latest release, which removes the vulnerable Dulwich usage, or switch Poetry’s VCS backend to the system git client.
  • Implement a CI pre‑check that scans repository commits for duplicate tree headers and rejects any that contain them before dependency installation.

Generated by OpenCVE AI on November 5, 2026 at 01:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Jelmer
Jelmer dulwich
Vendors & Products Jelmer
Jelmer dulwich
Type Values Removed Values Added
Description Dulwich before 1.2.20 contains a commit object parsing vulnerability where the read path in _parse_commit resolves a duplicate tree header to the last occurrence instead of the first, diverging from core git's resolution behavior, while Poetry 2.5.1 ships this version and uses dulwich by default for git dependency installation. Attackers can craft a commit object with two tree headers so that reviewers and CI using git see a benign tree while Poetry's dulwich-based checkout resolves to a different attacker-controlled tree containing malicious build scripts such as setup.py, resulting in unreviewed code execution on the install or build host.
Title Dulwich before 1.2.20 Commit Parser Tree Header Misinterpretation
Weaknesses CWE-115
CWE-1250
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.6, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-115

    Misinterpretation of Input

  • CWE-1250

    Improper Preservation of Consistency Between Independent Representations of Shared State

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 9, 2026, 4:55 PM
Reserved
Nov 4, 2026, 10:50 PM
Status
Deferred
Published
Nov 4, 2026, 11:17 PM
Modified
Nov 9, 2026, 5:17 PM
Severity
Important
Public date
Nov 4, 2026, 10:57 PM