<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Gix-Fs — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/gix-fs/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 30 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/gix-fs/feed.xml" rel="self" type="application/rss+xml"/><item><title>gix-fs Symlink Prefix-Reuse Worktree Escape</title><link>https://feed.craftedsignal.io/briefs/2024-01-30-gix-symlink-escape/</link><pubDate>Tue, 30 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-30-gix-symlink-escape/</guid><description>A vulnerability in rust's gix-fs library (&lt;= 0.21.0) allows a malicious actor to construct a tree that, when checked out with gitoxide, permits writing an attacker-controlled symlink into any existing directory the user has write access to, potentially leading to code execution.</description><content:encoded><![CDATA[<p>A critical vulnerability exists in the rust&rsquo;s gix-fs library, specifically in versions 0.21.0 and earlier. This flaw allows a malicious actor to craft a Git tree in such a way that, when checked out using gitoxide, an attacker-controlled symlink can be written into any directory on the file system where the user possesses write permissions. The vulnerability arises from the reuse of validated path prefixes during the checkout process, specifically when handling symlinks. Project Glasswing discovered this flaw, identified as CVE-2026-44471, which has the potential for privilege escalation and arbitrary code execution. The issue stems from how gix-fs handles symlinks during the checkout process, allowing malicious actors to bypass security checks.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious Git tree containing a symlink entry (&lsquo;a&rsquo;) pointing to a sensitive directory (e.g., &lsquo;.git/hooks&rsquo;).</li>
<li>The attacker creates a directory entry (&lsquo;a&rsquo;) within the same tree, including a subtree with a symlink (e.g., &lsquo;post-checkout&rsquo;) pointing to a payload file (&rsquo;../../payload&rsquo;).</li>
<li>The crafted Git tree is processed by <code>gix_index::State::from_tree()</code>, which converts it into index entries (e.g., [&ldquo;a&rdquo; (SYMLINK), &ldquo;a/post-checkout&rdquo; (SYMLINK)]).</li>
<li>During the delayed symlink phase of the checkout process, the symlink &lsquo;a&rsquo; is created, linking to the target directory (e.g., &lsquo;.git/hooks&rsquo;).</li>
<li>When processing &lsquo;a/post-checkout&rsquo;, the validated prefix &lsquo;a&rsquo; is reused, bypassing intermediate directory checks.</li>
<li>The <code>symlink()</code> function resolves through the previously created symlink (&lsquo;a&rsquo;), leading to the creation of a symlink at the attacker-controlled location (e.g., &lsquo;.git/hooks/post-checkout&rsquo;).</li>
<li>The attacker places an executable payload file (&lsquo;payload&rsquo;) in the repository.</li>
<li>Upon triggering the &lsquo;post-checkout&rsquo; hook (e.g., via <code>git checkout -b new-branch</code>), the payload is executed, resulting in arbitrary code execution.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to create arbitrary symlinks in any directory the user has write access to. This can lead to arbitrary code execution, privilege escalation, and potential system compromise. By writing to sensitive locations like <code>.git/hooks</code>, attackers can establish persistence and execute malicious code whenever Git commands are run. The impact is significant, as it allows attackers to bypass standard security checks and gain unauthorized access to the system.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a patched version of the <code>gix-fs</code> library that addresses CVE-2026-44471 to prevent exploitation of the symlink vulnerability.</li>
<li>Monitor process creation events for git processes creating symlinks in sensitive directories such as .git/hooks, using a detection rule focused on suspicious symlink creation.</li>
<li>Implement strict file integrity monitoring on critical system directories to detect unauthorized modifications, especially within <code>.git</code> directories.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>symlink</category><category>worktree-escape</category><category>gitoxide</category><category>gix-fs</category><category>code-execution</category></item></channel></rss>