dulwich is vulnerable to Path Traversal
86
High Risk
The pop() function in dulwich/stash.py uses os.path.exists() to check for a parent directory before writing stashed files, and that check follows symlinks. When an intermediate directory in a stashed path is a symlink pointing outside the worktree, the subsequent file writes resolve through the link. An attacker who convinces a victim to pop a stash inside a malicious repository can write attacker-controlled content to arbitrary filesystem locations such as .git/hooks/post-checkout, achieving remote code execution on the next git operation. The fix verifies that no component of the target path resolves through a symlink outside the repository before writing.
You are affected if you are using a version that falls within the vulnerable range and you pop a stash in an untrusted repository.
dulwich is vulnerable to Path Traversal in versions 0.23.2 - 1.2.7.
Upgrade the dulwich library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant