{"description":"Trending threats, MITRE ATT\u0026CK coverage, and detection metadata. Fed continuously.","favicon":"https://feed.craftedsignal.io/favicon-32x32.png","feed_url":"https://feed.craftedsignal.io/products/dulwich-0.22.5---1.2.7/feed.json","home_page_url":"https://feed.craftedsignal.io/","icon":"https://feed.craftedsignal.io/apple-touch-icon.png","items":[{"_cs_actors":[],"_cs_cpes":[],"_cs_cves":[],"_cs_exploited":false,"_cs_has_poc":false,"_cs_poc_references":[],"_cs_products":["dulwich (0.22.5 - 1.2.7)"],"_cs_severities":["high"],"_cs_tags":["arbitrary-file-write","path-traversal","execution"],"_cs_type":"advisory","_cs_vendors":[],"content_html":"\u003cp\u003eThe Dulwich library contains a path traversal vulnerability in its \u003ccode\u003estash.pop()\u003c/code\u003e function, specifically within \u003ccode\u003edulwich/stash.py\u003c/code\u003e. The vulnerability arises because the library uses \u003ccode\u003eos.path.exists()\u003c/code\u003e to verify directory paths before writing stashed files. Because \u003ccode\u003eos.path.exists()\u003c/code\u003e follows symlinks, it fails to detect when a target path resolves to a location outside the repository worktree. The \u003ccode\u003evalidate_path()\u003c/code\u003e function provides insufficient validation as it only checks against forbidden filenames and does not account for symlink resolution. This flaw affects Dulwich versions 0.22.5 through 1.2.7. An attacker can weaponize this by creating a repository with carefully crafted symlinks that, when popped by a victim, overwrite sensitive system files or local configuration files.\u003c/p\u003e\n\u003ch2 id=\"attack-chain\"\u003eAttack Chain\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eAttacker creates a malicious git repository containing a symlink (e.g., \u003ccode\u003elink\u003c/code\u003e pointing to \u003ccode\u003e../../.git/hooks\u003c/code\u003e).\u003c/li\u003e\n\u003cli\u003eAttacker creates a stash containing an executable payload file nested within that symlinked path (e.g., \u003ccode\u003elink/post-checkout\u003c/code\u003e).\u003c/li\u003e\n\u003cli\u003eVictim clones the malicious repository and checks out the branch containing the symlink.\u003c/li\u003e\n\u003cli\u003eVictim executes \u003ccode\u003estash.pop()\u003c/code\u003e on the malicious stash content.\u003c/li\u003e\n\u003cli\u003eDulwich evaluates the target path, where \u003ccode\u003eos.path.exists()\u003c/code\u003e confirms the presence of the directory via the symlink, bypassing safety checks.\u003c/li\u003e\n\u003cli\u003eThe \u003ccode\u003ebuild_file_from_blob()\u003c/code\u003e function writes the payload content directly to the resolved location.\u003c/li\u003e\n\u003cli\u003eThe payload is written to the victim's local \u003ccode\u003e.git/hooks/post-checkout\u003c/code\u003e file.\u003c/li\u003e\n\u003cli\u003eThe victim triggers the payload upon the next git checkout, resulting in Remote Code Execution.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"impact\"\u003eImpact\u003c/h2\u003e\n\u003cp\u003eSuccessful exploitation allows for arbitrary file writes on the victim's system. By targeting critical hooks like \u003ccode\u003e.git/hooks/post-checkout\u003c/code\u003e within the local environment, an attacker can gain arbitrary command execution under the user context of the victim, leading to full compromise of the local development workstation.\u003c/p\u003e\n\u003ch2 id=\"recommendation\"\u003eRecommendation\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eUpdate the Dulwich library to a patched version once available.\u003c/li\u003e\n\u003cli\u003eAudit all automated tooling that utilizes Dulwich for git repository management to ensure they are running with the least privilege necessary.\u003c/li\u003e\n\u003cli\u003eMonitor local development directories for unexpected creation or modification of git hook files using File Integrity Monitoring (FIM).\u003c/li\u003e\n\u003cli\u003eFor developers using the Dulwich library, implement path canonicalization using \u003ccode\u003eos.path.realpath()\u003c/code\u003e before file write operations to verify the target directory resides within the expected worktree.\u003c/li\u003e\n\u003c/ol\u003e\n","date_modified":"2026-10-02T20:23:31Z","date_published":"2026-10-02T20:23:31Z","id":"https://feed.craftedsignal.io/briefs/2026-10-dulwich-stash-traversal/","summary":"The Dulwich library stash pop implementation fails to validate symlinks, allowing attackers to write arbitrary files outside the repository worktree and achieve remote code execution.","title":"Arbitrary File Write in Dulwich via Symlink Directory Traversal","url":"https://feed.craftedsignal.io/briefs/2026-10-dulwich-stash-traversal/"}],"language":"en","title":"CraftedSignal Threat Feed - Dulwich (0.22.5 - 1.2.7)","version":"https://jsonfeed.org/version/1.1"}