dulwich is vulnerable to Improper Link Resolution Before File Access
86
CVE Score
High
Improper Link Resolution Before File Access
Dulwich's path-restricted porcelain.checkout(paths=...) writes files with a raw os.open(file_path, O_WRONLY|O_CREAT|O_TRUNC, mode) call that bypasses build_file_from_blob and follows symlinks at both the target file and intermediate directories. A crafted repository can leave a symlink at a checkout target so that restoring a specific path writes attacker-controlled content, with attacker-controlled mode bits, outside the work tree such as into .git/hooks. Planting an executable hook this way leads to remote code execution on the next checkout. The fix routes these writes through build_file_from_blob, which replaces an existing symlink with a fresh regular file instead of writing through it.
Upgrade the dulwich library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and use path-restricted porcelain.checkout(paths=...) on repositories from an untrusted source.
0.24.0 - 1.2.7
Fixed in 1.2.8dulwich is vulnerable to Improper Link Resolution Before File Access in versions 0.24.0 - 1.2.7.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.