Skip to main content
VulnerabilityPublished Updated

stash pop · Dulwich: Symlink directory traversal

Affects poetrySource GCVE Database

0

CVSS 8.6 High : upgrade to 2.4.2 soon.

Data as of 30 Oct 2026, 07:30 UTC

CVSS 3.1 base score
8.6High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 2.4.2
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

What to do

Upgrade poetry to 2.4.2.

Affected software

ProductAffectedFixed in
Homebrewpoetrypkg:brew/poetryOther threatsAffected
  • >=2.0.0 <2.4.2
Fixed in
  • 2.4.2

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available for this vulnerability. Users should upgrade to a fixed version of Dulwich that includes checks to ensure no path component resolves through symlinks outside the repository root before writing files. The fix involves validating paths using os.path.realpath() or opening files with O_NOFOLLOW to prevent symlink traversal. Until patched, avoid popping stashes from untrusted repositories.

Description

Dulwich's stash pop function in version 1.2.7 is vulnerable to a symlink directory traversal that allows an attacker to write arbitrary files outside the repository worktree. This occurs because the function uses os.path.exists() which follows symlinks, enabling writes through malicious intermediate symlinks. An attacker can craft a repository that, when a victim pops a stash, writes attacker-controlled files such as .git/hooks/post-checkout, leading to remote code execution on the victim's machine during subsequent git operations. A patch is available to mitigate this issue by verifying symlink resolution before writing files.

References

Community reviews

Loading reviews…