<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gitea on Schallbert's Blog</title><link>https://blog.schallbert.de/en/tags/gitea/</link><description>Recent content in Gitea on Schallbert's Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 04 Oct 2026</lastBuildDate><atom:link href="https://blog.schallbert.de/en/tags/gitea/index.xml" rel="self" type="application/rss+xml"/><item><title>Critical vulnerabilities in Gitea (and Forgejo)</title><link>https://blog.schallbert.de/en/gitea-critical-vulnerability-active-exploitation-rce/</link><pubDate>Sun, 04 Oct 2026</pubDate><author>Schallbert</author><guid>https://blog.schallbert.de/en/gitea-critical-vulnerability-active-exploitation-rce/</guid><description type="html">&#10; &lt;img src="https://blog.schallbert.de/assets/images/posts/2026-10-04-gitea-lower-than-V27-vulnerable-cve.avif"&#10; class="post-cover"&#10; alt="Image: The logo of Gitea, a cup of tea. It is boiling hot, and steam is emanating from the cup&amp;#39;s contents. In one of the steam clouds, there is a Jolly Roger. The image caption says &amp;#39;Gitea "&#10; title="Critical vulnerabilities in Gitea (and Forgejo)" /&gt;&#10;&lt;aside class="update-box update-box--error" role="note"&gt;&#10; &lt;span class="update-box__icon" aria-hidden="true"&gt;&#10; ⛔&#10; &lt;/span&gt;&#10;&#10; &lt;div class="update-box__body"&gt;&#10; &lt;div class="update-box__heading"&gt;&#10; &lt;strong class="update-box__title"&gt;&#10; &#10; Update: Also affects Forgejo v16.0.4 and below&#10; &#10; &lt;/strong&gt;&#10;&#10; &lt;time datetime="2026-10-02T00:00:00Z"&gt;&#10; 2026-10-02&#10; &lt;/time&gt;&#10; &#10; &lt;/div&gt;&#10;&#10; &#10; &lt;div class="update-box__content"&gt;&#10; Based on the &lt;a href="https://forgejo.org/releases/16.x/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;release notes&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, I consider the software forge solution &lt;a href="https://forgejo.org/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Forgejo&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; (a fork of Gitea) to be affected by the CVEs described below as well. All CVEs discussed in this article are resolved only in version v16.0.5 (released September 17, 2026) and later versions. Therefore, whenever the word &amp;lsquo;Gitea&amp;rsquo; appears in the article, Forgejo is explicitly included.&#10; &lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10;&lt;/aside&gt;&#10;&lt;h2 id="becoming-aware"&gt;Becoming Aware&lt;/h2&gt;&#10;&lt;p&gt;As is so often the case, this story begins with a network of human communication. This &lt;a href="https://blog.schallbert.de/en/gitea-critical-vulnerability-active-exploitation-rce/#credits"&gt;invaluable exchange&lt;/a&gt; has already contributed significantly to the security of the software powering this blog. Now, I am able to close another security vulnerability. But first things first.&lt;/p&gt;&#10;&lt;h3 id="gitea-as-a-target"&gt;Gitea as a Target&lt;/h3&gt;&#10;&lt;p&gt;I heard that the self-hosted version control solution &lt;a href="https://en.wikipedia.org/wiki/Gitea" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Gitea&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; used by an acquaintance of mine had become the target of an attack. This attack enabled &lt;a href="https://www.crowdstrike.com/en-us/cybersecurity-101/cyberattacks/remote-code-execution/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;RCE&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; (Remote Code Execution), which was subsequently exploited.&lt;/p&gt;&#10;&lt;h3 id="why-is-gitea-an-attractive-target"&gt;Why is Gitea an attractive target?&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Theft of (corporate) secrets: Access to repositories puts confidential source code at risk of exposure.&lt;/li&gt;&#10;&lt;li&gt;Exfiltration of access credentials: If a product with interfaces linked to Gitea is managed there, &lt;a href="https://en.wikipedia.org/wiki/API_key" target="_blank" rel="noopener noreferrer" class="external-link"&gt;API keys&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, accounts, and passwords are at risk if stored unencrypted. Tools like &lt;a href="https://dev.to/vnjogani/a-guide-to-git-secret-49g3" target="_blank" rel="noopener noreferrer" class="external-link"&gt;git-secret&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; offer a remedy, but they are not yet widely adopted due to the added complexity they introduce.&lt;/li&gt;&#10;&lt;li&gt;Classic privilege escalation: Under certain circumstances, breaking out of the Gitea software can allow an attacker to take over the entire machine.&lt;/li&gt;&#10;&lt;li&gt;Exploiting the &lt;a href="https://gitea.com/gitea/runner" target="_blank" rel="noopener noreferrer" class="external-link"&gt;runner&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;: If an attacker manages to hijack the runner, they can use the host machine&amp;rsquo;s resources. Even without elevated privileges. And misuse them for their own purposes (e.g., &lt;a href="https://dev.to/golu12/crypto-mining-is-killing-all-free-cicd-platforms-28ip" target="_blank" rel="noopener noreferrer" class="external-link"&gt;cryptominers in CI/CD&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="what-is-rce"&gt;What is RCE?&lt;/h3&gt;&#10;&lt;p&gt;Remote Code Execution (RCE) refers to a successful attack in which unauthorized code is injected and executed remotely over a network, without any action required by the owner or administrator of the affected resource.&lt;/p&gt;&#10;&lt;h2 id="the-gitea-ecosystem"&gt;The Gitea Ecosystem&lt;/h2&gt;&#10;&lt;p&gt;As a version control system and &lt;a href="https://en.wikipedia.org/wiki/Forge_%28software%29" target="_blank" rel="noopener noreferrer" class="external-link"&gt;forge&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, Gitea&amp;rsquo;s core functionality includes the ability to develop and build software collaboratively via a web interface. Consequently, the system is designed to allow users to register and, in some cases, execute &lt;a href="https://github.com/features/actions" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Actions&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; to automate software builds and/or deployments.&lt;/p&gt;&#10;&lt;p&gt;This very mechanism of automatically fetching and executing code can have serious consequences if security vulnerabilities exist within the management software itself.&lt;/p&gt;&#10;&lt;h3 id="vulnerability-via-open-registration"&gt;Vulnerability via Open Registration&lt;/h3&gt;&#10;&lt;p&gt;If an operator leaves the new account registration setting (&amp;ldquo;self-registration&amp;rdquo;) at its default value (&lt;code&gt;DISABLE_REGISTRATION = false&lt;/code&gt;) in the Gitea configuration, users can sign up, create their own repositories, open issues, and perform any action that does not require administrative privileges.&lt;/p&gt;&#10;&lt;p&gt;If the default setting &lt;code&gt;REQUIRE_SIGNIN_VIEW = false&lt;/code&gt; is also used, unauthenticated visitors can view public repositories, browse the Gitea site, and, most importantly, interact with the public &lt;a href="https://docs.gitea.com/api/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Gitea API&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h3 id="vulnerability-due-to-default-configuration-for-reverse-proxies"&gt;Vulnerability due to default configuration for reverse proxies&lt;/h3&gt;&#10;&lt;p&gt;In the default configuration of the Gitea Docker image, Gitea versions prior to v1.26.3 trust all proxies.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# gitea/app.ini&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[security]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;REVERSE_PROXY_LIMIT&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;REVERSE_PROXY_TRUSTED_PROXIES&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;* # This is a vulnerability!&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="the-security-vulnerabilities"&gt;The Security Vulnerabilities&lt;/h2&gt;&#10;&lt;p&gt;What are we dealing with here? Several critical security vulnerabilities with a &lt;a href="https://www.first.org/cvss/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;CVSS score&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; of &lt;code&gt;9.8/10&lt;/code&gt;, for which known instances of exploitation exist.&lt;/p&gt;&#10;&lt;figure class="media-frame media-frame--center"&gt;&#10; &lt;img src="https://blog.schallbert.de/assets/images/posts/2026-10-04-cvss-calculator.avif" alt="Image: Common vulnerability scoring system calculator. The selectors are switched in a way that reproduces a critical vulnerability over a network vector without user interaction as discussed in this post."&gt;&lt;/figure&gt;&#10;&lt;h3 id="side-note-the-cvss-rating"&gt;Side Note: The CVSS Rating&lt;/h3&gt;&#10;&lt;p&gt;To put the &amp;ldquo;critical&amp;rdquo; label into perspective: CVSS criteria are structured similarly to those used in classical hazard and &lt;a href="https://de.wikipedia.org/wiki/Risikoanalyse" target="_blank" rel="noopener noreferrer" class="external-link"&gt;risk analysis&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, a branch of engineering. Unlike in that field, however, the focus is not on analyzing potential failure modes, severity, probabilities of occurrence or failure, or detectability; instead, it centers on the difficulty of exploitation and the potential impact.&lt;/p&gt;&#10;&lt;h3 id="significance-of-individual-cvss-metrics"&gt;Significance of Individual CVSS Metrics&lt;/h3&gt;&#10;&lt;p&gt;The higher the CVSS score, the easier it is to exploit the vulnerability and the more severe the potential consequences regarding data security criteria (&lt;a href="https://en.wikipedia.org/wiki/CIA_triad" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Confidentiality, Integrity, Availability&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;). The image above illustrates a scenario involving a potential remote (network-based) attack that requires minimal effort (low complexity regarding system hardening) and no specific preconditions (such as targeting a specific vulnerable code path, requiring a specific system state, triggering a &lt;a href="https://en.wikipedia.org/wiki/Race_condition" target="_blank" rel="noopener noreferrer" class="external-link"&gt;race condition&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, etc.). Furthermore, the attack requires no elevated privileges (it can be performed as an unauthenticated/unauthorized guest) and involves no interaction with the system&amp;rsquo;s user or administrator.&lt;/p&gt;&#10;&lt;p&gt;In isolation, this might not be critical if the system is not required for operations (&lt;code&gt;Score 0.0&lt;/code&gt;) and holds no valuable data. However, if sensitive data is present (&lt;code&gt;Confidentiality, 8.7&lt;/code&gt;), or if there is a database whose values can be manipulated (&lt;code&gt;Integrity, 8.7&lt;/code&gt;), or even if the availability of essential data is compromised (&lt;code&gt;Availability, 8.7&lt;/code&gt;), the risk level shifts to &amp;ldquo;High.&amp;rdquo;&lt;/p&gt;&#10;&lt;p&gt;With this context in mind, we can now apply these concepts to the critical vulnerabilities found in Gitea.&lt;/p&gt;&#10;&lt;h3 id="cve-2026-20896-authentication-bug-in-gitea-through-reverse-proxies"&gt;CVE-2026-20896: Authentication bug in Gitea through reverse proxies&lt;/h3&gt;&#10;&lt;p&gt;If an attacker gains access behind the reverse proxy (or if no reverse proxy is deployed in front of the system), they can send a request containing the &lt;code&gt;X-WEBAUTH-USER&lt;/code&gt; header directly to the Gitea instance, effectively impersonating a reverse proxy. If Gitea is configured to &lt;a href="https://app.opencve.io/cve/CVE-2026-20896" target="_blank" rel="noopener noreferrer" class="external-link"&gt;trust all reverse proxies&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; (&lt;code&gt;REVERSE_PROXY_TRUSTED_PROXIES = *&lt;/code&gt;), it assumes that the user has &lt;a href="https://df00tech.com/detections/blog/cve-2026-20896" target="_blank" rel="noopener noreferrer" class="external-link"&gt;already been authenticated and a valid session exists&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;. The attacker thus gains user rights with write access to repositories, even though they haven&amp;rsquo;t even created an account.&lt;/p&gt;&#10;&lt;p&gt;The actual vulnerability here is the unquestioning trust placed in the header&amp;rsquo;s sender without any further validation against a session token or similar mechanism; simply accepting the header from external sources is what creates the vulnerability.&lt;/p&gt;&#10;&lt;p&gt;There is &lt;a href="https://www.cloudlinktech.com/news/active-attacks-exploit-critical-gitea-docker-auth-bug/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;evidence of attacks that have already exploited&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; this bug.&lt;/p&gt;&#10;&lt;h3 id="cve-2026-59774-file-read-flaw-affecting-any-file-readable-by-the-gitea-service-account"&gt;CVE-2026-59774: File-read flaw affecting any file readable by the Gitea service account&lt;/h3&gt;&#10;&lt;p&gt;This critical vulnerability is caused by insufficient input validation in &lt;a href="https://docs.gitea.com/next/administration/external-renderers/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Gitea&amp;rsquo;s built-in text renderer&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; for &lt;a href="https://en.wikipedia.org/wiki/Org-mode" target="_blank" rel="noopener noreferrer" class="external-link"&gt;org-mode&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; files. A detailed description of the attack vector and potential exploitation methods can be found on &lt;a href="https://www.satyamrastogi.com/blog/gitea-org-mode-unauthenticated-file-read-cve-2026-59774/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Satyam Rastogi&amp;rsquo;s&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; excellent blog.&lt;/p&gt;&#10;&lt;p&gt;In short, an attacker with access to at least one public repository can craft a malicious &lt;code&gt;.org&lt;/code&gt; file, e.g. to read Gitea&amp;rsquo;s &lt;code&gt;app.ini&lt;/code&gt; configuration. This allows them to access secrets contained within the file, granting them elevated privileges or enabling lateral movement within the system.&lt;/p&gt;&#10;&lt;p&gt;According to &lt;a href="https://thehackernews.com/2026/08/critical-gitea-flaw-let-unauthenticated.html" target="_blank" rel="noopener noreferrer" class="external-link"&gt;The Hacker News&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; and &lt;a href="https://github.com/go-gitea/gitea/security/advisories/GHSA-6v53-hr58-556r" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Gitea&amp;rsquo;s own team&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, this flaw can also be exploited to extract runner registration tokens and hijack the runners themselves.&lt;/p&gt;&#10;&lt;h3 id="cve-2026-60004-rce-allowing-an-attacker-with-standard-user-privileges-to-execute-arbitrary-shell-commands-as-the-gitea-os-user"&gt;CVE-2026-60004: RCE allowing an attacker with standard user privileges to execute arbitrary shell commands as the Gitea OS user.&lt;/h3&gt;&#10;&lt;p&gt;This security vulnerability is particularly severe because it also enables &lt;a href="https://www.thehackerwire.com/vulnerability/CVE-2026-60004/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;privilege escalation&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&amp;ldquo;The vulnerability in question is CVE-2026-60004 (CVSS score: 9.8), a case of remote code execution that allows an attacker with ordinary write access to a repository to execute arbitrary shell commands as the Gitea OS user.&amp;rdquo; - &lt;a href="https://thehackernews.com/2026/08/critical-gitea-rce-actively-exploited.html" target="_blank" rel="noopener noreferrer" class="external-link"&gt;thehackernews&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, Aug-2026&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Exploiting this vulnerability can therefore allow an attacker to take over the entire Gitea instance, provided they have write access to any repository (even a public one).&lt;/p&gt;&#10;&lt;h2 id="the-situation"&gt;The Situation&lt;/h2&gt;&#10;&lt;figure class="media-frame media-frame--right"&gt;&#10; &lt;img src="https://blog.schallbert.de/assets/images/posts/2026-10-04-gitea-cve-chaining.avif" alt="Image: A decision tree, connecting the dots between the three discussed CVEs. Baseline message is that the system has to be regarded as compromised in case an attacker is able to get ordinary write access to any repository on the instance which can be done by exploiting any of the discussed CVEs."&gt;&lt;/figure&gt;&#10;&lt;p&gt;There are other critical security vulnerabilities; however, by combining the scenarios described above, attackers can (without significant effort)&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Operate as normal users on the Gitea system &lt;em&gt;without having registered&lt;/em&gt; and &lt;em&gt;without requiring SSH access&lt;/em&gt;&lt;/li&gt;&#10;&lt;li&gt;Impersonate the Gitea service user&lt;/li&gt;&#10;&lt;li&gt;Take over Actions or even inject and execute workflows&lt;/li&gt;&#10;&lt;li&gt;With slightly more effort, take over the entire instance, encrypt it, demand a ransom, etc.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;My acquaintance&amp;rsquo;s experience involved points one and three. The attack was most likely automated, carried out after the internet had been scanned for vulnerable instances.&lt;/p&gt;&#10;&lt;p&gt;In summary, the case at hand appears to be a &lt;a href="https://www.techtimes.com/articles/325724/20260827/cisa-confirms-gitea-cve-2026-60004-exploited-cryptominer-hits-5000-exposed-dev-servers.htm" target="_blank" rel="noopener noreferrer" class="external-link"&gt;mass-exploitation campaign&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; aimed at cryptomining.&lt;/p&gt;&#10;&lt;h3 id="the-cryptominer"&gt;The Cryptominer&lt;/h3&gt;&#10;&lt;p&gt;On my acquaintance&amp;rsquo;s system, the following file is stored as a statically linked executable (!): &lt;code&gt;gitea/data/gitea/sys_health_s3&lt;/code&gt;&#10;In his view, the file&amp;rsquo;s hash suggests that an &lt;a href="https://github.com/xmrig/xmrig" target="_blank" rel="noopener noreferrer" class="external-link"&gt;XMRig cryptominer&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; was deployed as a &lt;a href="https://www.cloudflare.com/learning/security/glossary/malicious-payload/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;malicious payload&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;; it communicates with &lt;code&gt;pool.hashvault.pro&lt;/code&gt; and consumes a large portion of the available CPU power.&lt;/p&gt;&#10;&lt;h3 id="potential-for-even-greater-damage"&gt;Potential for Even Greater Damage&lt;/h3&gt;&#10;&lt;p&gt;I was even able to find &lt;a href="https://thehackernews.com/2026/09/red-heron-exploits-gitea-rce-to.html" target="_blank" rel="noopener noreferrer" class="external-link"&gt;a recent (Sep 2026) example on Hacker News&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; regarding a worst-case scenario: source code theft, credential harvesting, and privilege escalation leading to &lt;code&gt;root&lt;/code&gt; access on the affected system.&lt;/p&gt;&#10;&lt;h2 id="how-do-i-detect-an-attack"&gt;How do I detect an attack?&lt;/h2&gt;&#10;&lt;p&gt;In the worst case, you don&amp;rsquo;t. If professionals are at work targeting the system, only the log files from the time immediately following the breach might offer clues. Provided, of course, that you read and interpret them right away. But I digress&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#10;&lt;p&gt;Nevertheless, you should ask yourself the following questions:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Am I running a vulnerable version of Gitea (&lt;code&gt;&amp;lt;1.27.2&lt;/code&gt;)?&lt;/li&gt;&#10;&lt;li&gt;Have I avoided to use a monitoring solution that would have alerted me to anomalies?&lt;/li&gt;&#10;&lt;li&gt;Is there unusually &lt;em&gt;high system CPU load&lt;/em&gt;? This could reveal a cryptominer infection.&lt;/li&gt;&#10;&lt;li&gt;For this specific miner, you can also check if the following file exists on the system:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;find / -name &lt;span style="color:#e6db74"&gt;&amp;#39;.sys_health_s3&amp;#39;&lt;/span&gt; 2&amp;gt;/dev/null&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the answer to even one of these questions is &amp;ldquo;yes,&amp;rdquo; immediate action is required. Given the severity of the vulnerabilities, the entire host system could be considered compromised, and should be if the Gitea container or any attached runner was configured as &amp;ldquo;rootful&amp;rdquo; (i.e., granted access to the Docker socket).&lt;/p&gt;&#10;&lt;h3 id="in-case-of-infection-quarantine"&gt;In Case of Infection: Quarantine&lt;/h3&gt;&#10;&lt;p&gt;Next steps: Immediately isolate the affected machine and take it offline. Shut down the containers, reboot the host machine, and apply updates. Afterward, update your Docker registry images and check log files (look at timestamps!) to determine if other parts of the system are affected. For further details, see &lt;a href="https://blog.schallbert.de/en/gitea-out-of-memory/"&gt;my article about a Gitea attack I experienced firsthand&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="solutions"&gt;Solutions&lt;/h2&gt;&#10;&lt;h3 id="update-gitea"&gt;Update Gitea!&lt;/h3&gt;&#10;&lt;p&gt;Gitea urgently needs to be updated to a version &lt;code&gt;&amp;gt;1.27.1&lt;/code&gt;. To do this, you can modify the &lt;code&gt;docker-compose.yml&lt;/code&gt; file and then restart the containers:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yml" data-lang="yml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# docker-compose.yml&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;gitea&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;image&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gitea/gitea:latest&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;container_name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;gitea&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Further information on recent fixes can be found on &lt;a href="https://blog.gitea.com/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Gitea&amp;rsquo;s blog&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;. The major release (version 27) addresses a long list of critical security vulnerabilities. I have singled out only a few of them in this article, as they affect my immediate environment and exploits for them are known.&lt;/p&gt;&#10;&lt;h3 id="running-gitea-and-the-runner-in-rootless-mode"&gt;Running Gitea and the runner in &amp;ldquo;rootless&amp;rdquo; mode&lt;/h3&gt;&#10;&lt;p&gt;If the exploitation of a security vulnerability leads to the compromise of Gitea or the Action Runner, the host system itself should not also be compromised. Running them in a container can limit the potential damage. I have therefore described how to set up a &amp;ldquo;rootless&amp;rdquo; solution &lt;a href="https://blog.schallbert.de/en/gitea-act-runner-dind/"&gt;here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="additional-measures-hardening"&gt;Additional measures (hardening)&lt;/h2&gt;&#10;&lt;h3 id="cve-2026-20896-restricting-network-access"&gt;CVE-2026-20896: Restricting network access&lt;/h3&gt;&#10;&lt;p&gt;For the next steps, I am following the &lt;a href="https://df00tech.com/detections/CVE-2026-20896#kql" target="_blank" rel="noopener noreferrer" class="external-link"&gt;recommendation from d00ftech&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Include the address range of your reverse proxy. First, you need to determine the network address at which the reverse proxy is accessible. On my server, for example, both Gitea and the reverse proxy (Caddy) run within Docker. I therefore find the IP address as follows:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker inspect caddy &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--format&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;{{range $name, $network := .NetworkSettings.Networks}}{{$name}}: {{$network.IPAddress}}{{&amp;#34;\n&amp;#34;}}{{end}}&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;caddy-proxy: 172.20.0.2&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This value is now entered into &lt;code&gt;gitea/app.ini&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[security]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;REVERSE_PROXY_LIMIT&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;REVERSE_PROXY_TRUSTED_PROXIES&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;172.20.0.2/32&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="2"&gt;&#10;&lt;li&gt;Block direct network access to Gitea that bypasses your own reverse proxy. To do this, the Gitea port (usually &lt;code&gt;3000&lt;/code&gt;) must not appear in the port mappings—for example, in the Docker configuration:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yml" data-lang="yml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# docker-compose.yml&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;services&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;gitea&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ports&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#e6db74"&gt;&amp;#34;3000:3000&amp;#34;&lt;/span&gt; &lt;span style="color:#75715e"&gt;# remove this!&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="cve-2026-59774-update-gitea"&gt;CVE-2026-59774: Update Gitea!&lt;/h3&gt;&#10;&lt;p&gt;While it is possible to disable the org-mode renderer in &lt;code&gt;app.ini&lt;/code&gt; (see the &lt;a href="https://docs.gitea.com/next/administration/external-renderers/#appini-file-configuration" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Gitea documentation&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; on this topic), in my view, the far better approach is to update Gitea itself!&lt;/p&gt;&#10;&lt;h3 id="cve-2026-60004-disable-self-registration-if-possible"&gt;CVE-2026-60004: Disable self-registration if possible&lt;/h3&gt;&#10;&lt;p&gt;The actual fix requires updating the Gitea version. For smaller instances with few users, it may also make sense to disable self-registration for new users. From now on, they will have to request registration from the administrators (unless they exploit one of the other CVEs described above).&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# gitea/app.ini&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[service]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;DISABLE_REGISTRATION&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;true&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Other helpful settings include:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;REGISTER_EMAIL_CONFIRM&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;true # Requires user&amp;#39;s email to be confirmed for registration to complete&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;ENABLE_OPENID_SIGNUP&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;false # Disallow logons via external API&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;REQUIRE_SIGNIN_VIEW&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;true # Force users to login before they can view content or use the public API&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="outlook-and-conclusion"&gt;Outlook and Conclusion&lt;/h2&gt;&#10;&lt;p&gt;Version control systems are highly attractive targets for a wide range of attackers: from cryptominers seeking to hijack resources and ransomware groups targeting source code and credentials, to highly professional, targeted attackers and state-sponsored actors, given that the software effectively serves as a form of infrastructure.&lt;/p&gt;&#10;&lt;p&gt;Therefore:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&amp;ldquo;Apply all patches. Always. Immediately. Without exception.&amp;rdquo; - &lt;a href="https://codeberg.org/tomas-jakobs/fefe-blog-backup/src/branch/main/content/assets/hackback/hackback.htm#L509" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Felix von Leitner&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;, however, also says &lt;a href="https://www.bsi.bund.de/DE/Themen/Verbraucherinnen-und-Verbraucher/Informationen-und-Empfehlungen/Cyber-Sicherheitsempfehlungen/Updates-Browser-Open-Source-Software/Wichtige-Softwareupdates/wichtige-softwareupdates_node.html" target="_blank" rel="noopener noreferrer" class="external-link"&gt;BSI&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;What leaves me feeling a bit perplexed is the sheer number and severity of the security vulnerabilities that have been patched (35 CVEs in a single month, according to Gitea&amp;rsquo;s own blog!). From my naive security perspective, this solution is full of holes and I&amp;rsquo;m not sure if I should keep running Gitea.&lt;/p&gt;&#10;&lt;h3 id="immediate-harden-the-system"&gt;Immediate: Harden the system&lt;/h3&gt;&#10;&lt;p&gt;Obviously: Update Gitea to &lt;code&gt;latest&lt;/code&gt; and implement the hardening measures described above.&lt;/p&gt;&#10;&lt;h3 id="short-term-automated-updates"&gt;Short-term: Automated updates&lt;/h3&gt;&#10;&lt;p&gt;Over the coming days and weeks, I&amp;rsquo;ll be working on automatically scanning the Docker registry for software updates and deploying them to my server automatically as well. A blog post will follow!&lt;/p&gt;&#10;&lt;h3 id="medium-term-time-for-monitoring"&gt;Medium-term: Time for monitoring&lt;/h3&gt;&#10;&lt;p&gt;I&amp;rsquo;ll be looking for a small, lightweight monitoring solution that flags anomalies—such as &amp;ldquo;CPU load unusually high since HH:MM:SS&amp;rdquo;—and can both execute and monitor &lt;a href="https://oneuptime.com/blog/post/2026-01-06-docker-health-checks/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;health checks&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;. Crucially, the tool itself shouldn&amp;rsquo;t become a potential entry point for attackers, meaning it needs to operate with virtually no privileges. I wonder if that&amp;rsquo;s easily achievable?&lt;/p&gt;&#10;&lt;h3 id="medium-term-2-get-rid-of-secrets"&gt;Medium-term 2: Get rid of secrets&lt;/h3&gt;&#10;&lt;p&gt;Unencrypted secrets have no place in repositories. Even a &lt;code&gt;.env&lt;/code&gt; file sitting on the host itself can no longer be considered secure. I&amp;rsquo;ll be giving this some thought and will report back once I&amp;rsquo;ve rolled out a solution.&lt;/p&gt;&#10;&lt;h3 id="medium-term-3-set-up-news-feeds"&gt;Medium-term 3: Set up news feeds&lt;/h3&gt;&#10;&lt;p&gt;This involves subscribing to newsletters or RSS feeds, ideally from all my software vendors, IT security institutions or journalists, and other sources. To stay informed about security vulnerabilities, patches, and system hardening measures.&lt;/p&gt;&#10;&lt;h3 id="credits"&gt;Long-term: Keeping the conversation going&lt;/h3&gt;&#10;&lt;p&gt;It ends just as it begins. Before I can solve problems with my software, before I even know those problems exist, right there! At the very beginning, before I&amp;rsquo;ve even decided which software to use, there are: other people.&lt;/p&gt;&#10;&lt;p&gt;People I can ask questions or turn to for help. People whose time I can claim for my own needs. Like messaging them out of the blue and pulling them away from what they were focused on.&lt;/p&gt;&#10;&lt;p&gt;People who know more than I do, who see things differently, or whose opinions I find interesting.&lt;/p&gt;&#10;&lt;p&gt;Colleagues, current and former. Acquaintances, friends, and family whom I meet, whether by chance or by appointment, to connect. Over coffee, ice cream, or a cold drink; to make music or spend an afternoon playing board games.&lt;/p&gt;&#10;&lt;p&gt;People who help me kindly and patiently, despite the interruptions and my silly questions. People who might roll their eyes for a moment but then explain things to me one more time anyway. People who somehow tolerate my monologues, critical follow-up questions, and occasional pushback.&lt;/p&gt;&#10;&lt;p&gt;People with whom I can engage in an exchange that, in the end, hopefully benefits both sides.&lt;/p&gt;&#10;&lt;p&gt;&lt;figure class="media-frame media-frame--left"&gt;&#10; &lt;img src="https://blog.schallbert.de/assets/images/root/Schallbert.avif" alt="Image: A computer-drawn image of Schallbert, pixelized, and in 256 colors."&gt;&lt;/figure&gt;&#10;Thanks to all of you. Everything is much easier with people like you. Including running this blog, which takes a lot of my time. With you, I can discuss decisions, learn how you did things (and why you did them that way), and shift perspectives. And develop new ideas.&lt;/p&gt;&#10;&lt;p&gt;Please stay in my life.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;A nod to &lt;a href="https://de.wikipedia.org/wiki/Fefes_Blog" target="_blank" rel="noopener noreferrer" class="external-link"&gt;&amp;ldquo;Fefe&amp;rdquo; Felix von Leitner&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;. Quote: &amp;ldquo;Assumptions [&amp;hellip;]: We are being attacked. We notice it promptly. Experience shows: No, we don&amp;rsquo;t. Typical timeframe before detecting stowaways: six months to five years.&amp;rdquo; - from the &lt;a href="https://codeberg.org/tomas-jakobs/fefe-blog-backup/src/commit/5d0e24d085463a5fc3b852edb589347f6d909a85/content/assets/hackback/hackback.htm#L634" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Hackback&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt; presentation; link leads to &lt;a href="https://codeberg.org/" target="_blank" rel="noopener noreferrer" class="external-link"&gt;Codeberg&lt;span class="external-link-icon" aria-hidden="true"&gt;↗&lt;/span&gt;&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</description></item></channel></rss>