<?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>Gitea Ltd - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/gitea-ltd/</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>Tue, 21 Jul 2026 21:52:53 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/gitea-ltd/feed.xml" rel="self" type="application/rss+xml"/><item><title>Gitea OAuth Callback Re-enables Administrator-Disabled Accounts</title><link>https://feed.craftedsignal.io/briefs/2026-07-gitea-oauth-reenable/</link><pubDate>Tue, 21 Jul 2026 21:52:53 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-gitea-oauth-reenable/</guid><description>An improper authorization vulnerability in Gitea's OAuth2 sign-in callback mechanism (CVE-2026-58422) allows users with linked external identity providers to unilaterally re-enable their administrator-disabled accounts, regaining full access and bypassing security controls.</description><content:encoded><![CDATA[<p>A high-severity improper authorization vulnerability, identified as CVE-2026-58422, affects Gitea versions prior to 1.26.4. This flaw allows users whose accounts have been disabled by an administrator to bypass this restriction and regain full access to their Gitea repositories, organizations, and access tokens. The vulnerability resides within the OAuth2 sign-in callback functionality, specifically in the <code>handleOAuth2SignIn</code> function. When a user with a previously linked external identity provider attempts to authenticate through OAuth2, the Gitea application logic incorrectly re-enables their locally disabled account and grants them a fresh authenticated session. This effectively nullifies administrator-initiated account disablement, posing a significant risk to incident response efforts, especially in environments relying on account deactivation for compromised or departed user scenarios.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An administrator configures an OAuth2 authentication source within Gitea, linking it to an external Identity Provider (IdP).</li>
<li>A user, e.g., &quot;Alice,&quot; signs into Gitea at least once via this OAuth2 source, establishing a link between her local Gitea account and the external IdP.</li>
<li>A Gitea administrator subsequently disables Alice's account through the <code>Site Administration</code> panel, setting her <code>IsActive</code> flag to <code>false</code>.</li>
<li>Alice attempts to sign in again using the previously linked external IdP, triggering the OAuth2 authentication flow.</li>
<li>The Gitea application's <code>/user/oauth2/{source-name}/callback</code> endpoint processes the authentication request.</li>
<li>Within the <code>routers/web/auth/oauth.go::handleOAuth2SignIn</code> function, the application reads the user's <code>IsActive</code> flag and, despite it being <code>false</code>, incorrectly sets <code>opts.IsActive = optional.Some(true)</code>.</li>
<li>The <code>user_service.UpdateUser</code> function is called, which updates Alice's account in the database, effectively re-enabling it without administrative approval.</li>
<li>Gitea issues a new authenticated session to Alice, granting her full read and write access to her repositories, organizations, and tokens, bypassing the administrator's disable action.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>This vulnerability allows users to circumvent administrative account disablement, leading to unauthorized access and persistence. In organizations utilizing Gitea, particularly those integrated with Single Sign-On (SSO) systems where account disablement is a critical incident response measure for compromised credentials or employee departures, this flaw completely undermines security protocols. Affected Gitea deployments risk former employees or attackers with compromised external IdP access continuously regaining access, leading to data exfiltration, unauthorized code commits, or other malicious activities, even after an administrator has attempted to revoke access.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Patch Gitea installations to version 1.26.4 or later immediately to address CVE-2026-58422.</li>
<li>Review audit logs for <code>UpdateUser</code> actions originating from OAuth callback processes for users previously disabled by an administrator.</li>
<li>Consider implementing out-of-band monitoring for unexpected account re-activations, especially for accounts marked as disabled.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>improper-authorization</category><category>oauth</category><category>account-takeover</category><category>persistence</category><category>vulnerability</category></item><item><title>Gitea Server-Side Request Forgery Vulnerabilities</title><link>https://feed.craftedsignal.io/briefs/2026-07-gitea-ssrf/</link><pubDate>Tue, 21 Jul 2026 21:17:37 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-gitea-ssrf/</guid><description>Two Server-Side Request Forgery (SSRF) vulnerabilities in Gitea version 1.26.2 and earlier allow authenticated users to bypass IP filtering for webhooks and repository migrations by targeting CGNAT and IPv6 transition prefixes, and unauthenticated users to trigger arbitrary GET requests against internal hosts via the OpenID sign-in form, potentially leading to internal network discovery and data exposure.</description><content:encoded><![CDATA[<p>Two distinct Server-Side Request Forgery (SSRF) vulnerabilities have been identified in Gitea, affecting versions up to and including 1.26.2. The first finding concerns the <code>hostmatcher</code> IP classification logic used for outbound HTTP requests initiated by webhooks and repository migrations. This filter, intended to prevent internal network access, incorrectly allows connections to CGNAT (100.64.0.0/10) and several IPv6 transition prefixes, including NAT64, 6to4, and Teredo. An authenticated user can exploit this by crafting a webhook or migration URL to an internal CGNAT IP, causing Gitea to fetch the resource and store the response (up to 1MB) for retrieval. The second finding relates to the OpenID sign-in form, which, when enabled, allows unauthenticated users to provide a malicious OpenID provider URL. Gitea then fetches this URL server-side using <code>http.DefaultClient</code> without any IP filtering, enabling arbitrary GET requests against internal network resources. Both vulnerabilities can lead to significant internal network reconnaissance and potential data exfiltration from the Gitea host.</p>
<h2 id="attack-chain">Attack Chain</h2>
<h3 id="scenario-1-authenticated-webhookmigration-ssrf">Scenario 1: Authenticated Webhook/Migration SSRF</h3>
<ol>
<li>Attacker establishes authenticated access to a Gitea instance, either as a regular user or a repository administrator.</li>
<li>Attacker navigates to the webhook creation interface or initiates a repository migration.</li>
<li>Attacker crafts a malicious URL for the webhook or migration target, specifying an internal host within a CGNAT IP range (e.g., <code>http://100.64.0.2:8080/internal</code>) or an unblocked IPv6 transition prefix.</li>
<li>The crafted URL is submitted via Gitea's API for webhook or migration configuration.</li>
<li>Gitea's <code>hostmatcher</code> IP filter, due to a flaw in its <code>IsGlobalUnicast() &amp;&amp; !IsPrivate()</code> logic, fails to block the CGNAT or IPv6 transition range IP.</li>
<li>Gitea initiates an outbound HTTP request to the specified internal CGNAT host.</li>
<li>The target internal host's HTTP response, including status, headers, and body (up to 1 MB), is captured by Gitea.</li>
<li>Attacker retrieves the stored response from the webhook delivery logs or migration details, gaining insights into internal network services or sensitive data.</li>
</ol>
<h3 id="scenario-2-unauthenticated-openid-ssrf">Scenario 2: Unauthenticated OpenID SSRF</h3>
<ol>
<li>The Gitea instance has OpenID sign-in enabled, which is the default setting prior to initial installation completion (<code>!InstallLock</code>) or explicitly configured afterwards.</li>
<li>An unauthenticated attacker sends a specially crafted HTTP POST request to Gitea's <code>/user/login/openid</code> endpoint.</li>
<li>The POST request includes an <code>openid</code> parameter with a URL pointing to an internal IP address (e.g., <code>http://192.168.1.100/admin</code>) within the Gitea's network.</li>
<li>Gitea's <code>openid-go</code> library, responsible for OpenID discovery, uses <code>http.DefaultClient</code> without any IP filtering or <code>hostmatcher</code> integration.</li>
<li>Gitea initiates an outbound HTTP GET request to the internal IP address specified in the <code>openid</code> parameter.</li>
<li>The internal service receives the GET request from Gitea, potentially triggering actions, revealing its presence, or exposing information, even if the response is not directly returned to the attacker.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of these SSRF vulnerabilities can lead to significant internal network reconnaissance, allowing attackers to discover active hosts, open ports, and running services within the Gitea environment. For the webhook and migration SSRF, sensitive information (up to 1MB of HTTP response data) from internal services can be exfiltrated and viewed by the attacker, potentially revealing API keys, configuration details, or other confidential data. While the OpenID SSRF does not directly exfiltrate data to the attacker, it enables unauthenticated port scanning and interaction with internal services, which can be a precursor to more sophisticated attacks, including lateral movement or exploitation of other internal vulnerabilities. Organizations using Gitea versions 1.26.2 or older are at risk, particularly those with OpenID sign-in enabled or those that allow user-created webhooks and repository migrations.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule to detect attempts at exploiting the OpenID SSRF vulnerability via webserver logs.</li>
<li>Patch Gitea instances to the latest available version immediately, as fixes for these SSRF vulnerabilities are expected in subsequent releases.</li>
<li>Restrict outbound network access from Gitea servers to only necessary external endpoints using firewall rules to mitigate the impact of SSRF, even if internal IP filtering is bypassed.</li>
<li>If OpenID sign-in is not strictly required, disable it in Gitea's configuration to eliminate the unauthenticated SSRF vector.</li>
<li>Monitor Gitea's outgoing network connections for attempts to contact internal IP addresses, especially those in CGNAT ranges (e.g., 100.64.0.0/10) or RFC 1918 ranges, which would indicate successful exploitation of the webhook/migration SSRF.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>ssrf</category><category>gitea</category><category>web-vulnerability</category><category>internal-reconnaissance</category></item><item><title>Gitea Incomplete SSRF Protection in Webhook and Migration Allow-list</title><link>https://feed.craftedsignal.io/briefs/2026-07-gitea-ssrf-bypass/</link><pubDate>Tue, 21 Jul 2026 20:30:56 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-gitea-ssrf-bypass/</guid><description>An incomplete Server-Side Request Forgery (SSRF) protection in Gitea versions prior to 1.26.3 allows authenticated users to bypass the allow-list in webhook delivery and repository migrations, enabling internal network probing and data exfiltration from sensitive services like cloud metadata endpoints.</description><content:encoded><![CDATA[<p>A critical vulnerability, CVE-2026-22874, exists in Gitea versions prior to 1.26.3, stemming from an incomplete Server-Side Request Forgery (SSRF) protection mechanism. The allow-list, <code>MatchBuiltinExternal</code>, used for webhook delivery and repository migrations, relies on Go's standard library <code>net.IP.IsPrivate()</code> function. This function's definition of &quot;private&quot; is too narrow, covering only RFC 1918 and RFC 4193 ranges. As a result, several commonly used internal IP ranges, such as RFC 6598 Carrier-Grade NAT (<code>100.64.0.0/10</code>), Azure WireServer (<code>168.63.129.16</code>), specific non-RFC1918 <code>172.x.x.x</code> ranges, and various IPv6 transition mechanisms (e.g., NAT64 <code>64:ff9b::/96</code>, Teredo <code>2001::/32</code>), are not blocked. An authenticated user can exploit this to make Gitea initiate HTTP requests to these unblocked internal or cloud metadata endpoints and retrieve the full responses via the webhook history UI. This allows for internal network reconnaissance and sensitive data exfiltration.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An authenticated user gains access to a Gitea instance.</li>
<li>The user navigates to a repository where they have permissions to create or modify a webhook, or initiate a repository migration.</li>
<li>The user configures the webhook's target URL (or migration source URL) to point to an IP address within one of the bypassable internal ranges, such as <code>http://168.63.129.16/metadata</code> for Azure metadata, or <code>http://100.64.0.1/internal_api</code> for a Carrier-Grade NAT network.</li>
<li>Gitea attempts to deliver the webhook or perform the migration. Its internal host matcher, <code>MatchBuiltinExternal</code>, uses <code>net.IP.IsPrivate()</code> to validate the target IP.</li>
<li>Due to the narrow definition of <code>IsPrivate()</code>, the target IP is incorrectly deemed &quot;public&quot; and the connection is allowed.</li>
<li>Gitea's server-side process makes an HTTP request to the specified internal resource, bypassing expected network segmentation.</li>
<li>The internal resource responds (e.g., with cloud credentials or internal service configuration), and Gitea captures the full HTTP response, including status, headers, and up to 1 MiB of the body.</li>
<li>The authenticated user accesses the webhook history UI for the configured webhook, which displays the captured response, effectively exfiltrating data from the internal network.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of CVE-2026-22874 grants an authenticated attacker the ability to perform extensive Server-Side Request Forgery (SSRF) attacks against the internal network where the Gitea instance is hosted. This can lead to the compromise of sensitive internal systems and data. Specific impacts include accessing cloud metadata endpoints (e.g., AWS IMDS via NAT64, Azure WireServer), probing and exfiltrating data from internal services operating on Carrier-Grade NAT (<code>100.64.0.0/10</code>) or non-RFC1918 <code>172.x.x.x</code> ranges. The non-blind nature of the SSRF means attackers can read full HTTP response bodies through the webhook history UI, allowing for reconnaissance, sensitive information disclosure, and potential privilege escalation by acquiring credentials or API keys.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Gitea to version 1.26.3 or later immediately to address CVE-2026-22874.</li>
<li>Review your Gitea server's outbound network connections for anomalous activity to the IP ranges listed in the IOC table, particularly to cloud metadata service IP addresses.</li>
<li>Implement network egress filtering on the Gitea server to restrict outbound connections to only necessary and explicitly allowed external destinations, blocking all communication to the internal and cloud metadata IP ranges mentioned in this brief.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>ssrf</category><category>web-application</category><category>data-exfiltration</category><category>vulnerability</category><category>github</category><category>gitea</category><category>authorization-bypass</category><category>information-disclosure</category><category>api</category><category>server-side</category><category>github-advisory</category><category>privilege-escalation</category><category>supply-chain-attack</category><category>git-platform</category></item></channel></rss>