<?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>Forgejo (1.17 - 1.27.0) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/forgejo-1.17---1.27.0/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Mon, 03 Aug 2026 14:08:33 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/forgejo-1.17---1.27.0/feed.xml" rel="self" type="application/rss+xml"/><item><title>Critical Pre-Authentication RCE in Gitea and Forgejo</title><link>https://feed.craftedsignal.io/briefs/2026-08-cve-2026-60004-gitea-rce/</link><pubDate>Mon, 03 Aug 2026 14:08:33 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-cve-2026-60004-gitea-rce/</guid><description>CVE-2026-60004 is a critical pre-authentication RCE vulnerability in Gitea and Forgejo platforms caused by an unsafe bare clone design in the diffpatch API endpoint, enabling arbitrary command execution via injected Git hooks.</description><content:encoded><![CDATA[<p>CVE-2026-60004 is a critical-severity (CVSS 9.8) pre-authentication remote code execution vulnerability impacting Gitea and Forgejo self-hosted platforms, specifically versions 1.17 through 1.27.0. The vulnerability stems from a design flaw in the <code>POST /api/v1/repos/{owner}/{repo}/diffpatch</code> API endpoint. During a diffpatch operation, the platform performs a bare temporary clone where the repository root coincides with <code>$GIT_DIR</code>.</p>
<p>An attacker can leverage default open registration settings to create an account and obtain repository write access. By submitting a specially crafted patch twice, the attacker triggers an add/add conflict. Git's three-way merge fallback (<code>-3</code>) incorrectly writes the resulting merged file, which contains an attacker-supplied <code>post-index-change</code> Git hook, directly into the <code>$GIT_DIR/hooks/</code> directory. Git automatically executes this hook upon index updates, granting the attacker arbitrary code execution under the context of the Gitea service account. The exploit was publicly released on Sploitus on August 3, 2026.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker creates an account on a target instance, utilizing default open registration settings.</li>
<li>Attacker initializes a private repository to obtain the required write access.</li>
<li>Attacker sends a POST request to <code>/api/v1/repos/{owner}/{repo}/diffpatch</code> with a patch targeting <code>hooks/post-index-change</code>.</li>
<li>The server creates a bare temporary clone, placing the hook path directly into <code>$GIT_DIR/hooks/</code> due to the bare repository root design.</li>
<li>Attacker sends the identical patch a second time, triggering an add/add conflict in the Git process.</li>
<li>Git's three-way merge fallback (<code>-3</code>) resolves the conflict by writing the malicious hook file to disk.</li>
<li>The system updates the Git index, causing Git to unconditionally execute the now-executable <code>post-index-change</code> hook.</li>
<li>The hook executes the attacker's payload (e.g., reverse shell or output exfiltration via <code>curl</code>) under the Gitea service account.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation grants an unauthenticated attacker full command execution on the host server. Given the nature of Gitea/Forgejo deployments, this often leads to total infrastructure compromise, data exfiltration from private repositories, and potential lateral movement into the hosting environment. Exploits are actively circulating in public repositories as of August 2026.</p>
<h2 id="recommendation">Recommendation</h2>
<ol>
<li>Upgrade all Gitea and Forgejo instances to version 1.27.1 or higher immediately to apply the fix for CVE-2026-60004.</li>
<li>Implement the Sigma rule provided below to monitor for suspicious patterns of <code>diffpatch</code> API usage combined with account creation.</li>
<li>Disable public registration on internet-facing Gitea/Forgejo instances if not strictly required to mitigate initial access.</li>
<li>Perform forensic analysis on the host file systems for unexpected files located in <code>hooks/</code> directories of repository paths, specifically searching for <code>post-index-change</code>.</li>
<li>Review web server logs for high volumes of <code>diffpatch</code> POST requests originating from new user accounts.</li>
</ol>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>remote-code-execution</category><category>git</category><category>vulnerability</category><category>gitea</category><category>forgejo</category></item></channel></rss>