CVE-2026-122299 · Package
NO FIX YET · SEE WHAT TO DO
Dulwich, a pure-Python Git library, resolves a commit object with two tree headers to the last one instead of the first, unlike core git. An attacker can make reviewers see a benign tree while Poetry's git dependency install checks out a malicious tree containing build scripts such as setup.py, which then run on the install or build host.
first public Nov 4, 2026 · 1 source
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
Teams that install Python packages from git dependencies with Poetry, or that use dulwich directly, on build hosts or CI runners. Projects that do not install from git URLs and do not use dulwich directly are not exposed. The sources do not say whether the flaw is reachable through a package registry install alone.
Not affected if dulwich-at-1.2.20-or-later, no-git-dependencies
Who cares ci, dulwich, poetry, python
pip show dulwich or poetry show dulwich, and compare it to the fixed version.poetry --version and whether it installs git dependencies.dulwich in lockfiles and build environments.1.2.20 or later.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.
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
This page as .md · .json · 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/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
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.