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.