Skip to content

Gitea RCE Flaw Is Now Being Exploited in the Wild

A critical Gitea RCE flaw, CVE-2026-60004, is now being actively exploited. Here is how the vulnerability works, who is exposed, and what administrators should do.

Gitea RCE Flaw Is Now Being Exploited in the Wild

On this page

A critical Gitea vulnerability that was patched last month has moved from a software-security problem to an active attack risk. On August 25, 2026, the U.S. Cybersecurity and Infrastructure Security Agency (CISA) added CVE-2026-60004 to its Known Exploited Vulnerabilities catalog, and security researchers have since reported attacks against vulnerable self-hosted Gitea servers.

The flaw matters because the vulnerable component is a Git repository operation, not an obscure administrative feature. Under the right configuration, an attacker can turn repository-controlled patch data into a Git hook and use it to execute commands with the privileges of the Gitea service account. Administrators running Gitea versions before 1.27.1 should treat this as an incident-response issue as well as a patching task.

Why the Gitea RCE flaw is more serious than a normal repository bug

Gitea is a self-hosted Git platform, meaning organizations can run their own Git repositories, code review, issue tracking and related development services instead of relying entirely on a hosted provider. CVE-2026-60004 affects Gitea versions 1.17 through 1.27.0 and was fixed in version 1.27.1. The vulnerability has a CVSS score of 9.8 out of 10, placing it in the critical category.

The dangerous part is the diffpatch endpoint. This endpoint processes patches submitted against repositories. A flaw in the way Gitea prepares a temporary bare Git repository allows specially crafted patch content to escape the intended file-handling path and create an executable Git hook. A Git hook is a program Git automatically runs when particular repository operations occur, so turning attacker-controlled content into a hook changes a repository operation into server-side code execution.

The attacker does not initially need administrator privileges. Gitea's advisory says ordinary repository write access is enough. On installations where open user registration remains enabled, an outside visitor can potentially create an account and repository and obtain the required write access without an administrator granting it manually.

How the vulnerable patch-processing path leads to code execution

The technical problem comes from the interaction between Gitea's patch-processing logic and Git's three-way merge behavior. Gitea applies the supplied patch inside a temporary bare clone and uses Git's index-based patch operation. On Git versions 2.32 and newer, Gitea also enables a three-way fallback for certain conflicts. When the same specially prepared patch is submitted more than once, an add/add conflict can cause Git's fallback behavior to write an indexed path into the bare repository's Git directory.

That distinction is crucial. In a normal Git repository, the working tree and the internal .git directory are separate. A bare repository has no working tree, so its repository directory is effectively the Git directory itself. Because of that layout, a path that reaches the hooks directory can become an actual Git hook rather than an ordinary repository file.

Once the hook is installed, Git can invoke it during the index operation. The resulting commands run with the permissions of the Gitea operating-system account. The exact damage therefore depends on how the server is deployed, what repositories and secrets that account can access, and whether additional isolation exists between Gitea and the rest of the host.

Active exploitation changes the response priority

The vulnerability was disclosed by Gitea on July 28, 2026, and version 1.27.1 was already available as the fixed release. At that point, administrators had a conventional patching problem. The situation changed when CISA added CVE-2026-60004 to its Known Exploited Vulnerabilities catalog on August 25. Canadian and Polish cybersecurity authorities have also warned that the vulnerability is being actively exploited.

That does not mean every vulnerable Gitea server has been compromised. It does mean defenders should no longer assume that applying the patch eventually is sufficient. A server that remained exposed after public exploit material became available needs to be checked for evidence of unauthorized activity, particularly if registration was open or untrusted users could create repositories.

One reported incident involved an attacker compromising a self-hosted Gitea installation and deploying cryptocurrency-mining software. The report is independent of the vendor's original advisory, and CISA's KEV entry confirms exploitation but does not provide a detailed public description of every attack observed. That distinction matters: active exploitation is confirmed, while individual payloads and incident details should be treated according to the evidence available for each case.

Who is exposed, and who is not

The affected version range is Gitea 1.17 through 1.27.0. Gitea 1.27.1 and later contain the relevant fix, although administrators should install the latest supported release rather than stopping at the minimum fixed version.

The practical risk is highest for internet-accessible self-hosted installations that permit account registration or allow untrusted users to create repositories. A tightly controlled internal Gitea server with no public registration and carefully restricted repository permissions has a smaller attack surface, but it is not automatically safe if a compromised or malicious account already has repository write access.

Cloud-hosted Gitea services are a different case because the underlying infrastructure is managed by the provider. Gitea reported that Gitea Cloud instances would be upgraded automatically when the fix was released, so customers should confirm their provider's current patch status rather than assuming that a self-hosted remediation procedure applies to them.

What administrators should do now

The first step is straightforward: identify every self-hosted Gitea instance and determine its exact version. Any installation running 1.27.0 or earlier within the affected range should be upgraded to a fixed release immediately. Gitea's own advisory identifies 1.27.1 as the patched version, while the Canadian Cybersecurity Centre specifically notes that both 1.27.1 and 1.27.2 releases are available.

Patching alone is not enough if the server may already have been targeted. Review authentication records, repository creation activity, unusual API requests and unexpected changes to repositories. Because exploitation can result in commands running as the Gitea service account, investigate unexpected child processes, newly created files, unfamiliar scheduled tasks and network connections originating from the Gitea host.

Administrators should also review whether open registration is actually required. Closing public registration removes the easy path in which an unauthenticated visitor creates an account and repository, although it does not eliminate the vulnerability for an attacker who already possesses legitimate repository write access. Repository creation permissions should therefore be restricted as part of the same review.

If compromise is suspected, treat the Gitea server as potentially exposed beyond its repositories. The vendor warns that exploitation may expose application configuration, process environment secrets, mounted repositories, database credentials, OAuth credentials and access to other services depending on the deployment. That makes credential rotation and a broader host investigation appropriate after confirmed exploitation rather than simply reinstalling the application and moving on.

The bigger lesson is about developer infrastructure

CVE-2026-60004 is a useful reminder that developer platforms are security infrastructure. A Git service may look like a place where developers store source code, but the server handling those repositories often has access to databases, deployment credentials, continuous integration systems, cloud tokens and internal networks. A vulnerability that begins with a repository operation can therefore become an entry point into much more valuable systems.

The Gitea case also shows why configuration matters as much as the vulnerability itself. The underlying bug requires repository write access, but open registration can turn that requirement into something an external visitor can satisfy. Restricting account creation, limiting repository permissions and isolating the service account do not replace patching, but they can significantly reduce the blast radius when a vulnerability is discovered.

What to watch after the patch

The immediate question for Gitea operators is no longer whether a fix exists; it is whether an exposed instance was accessed before it was fixed. CISA's decision to place CVE-2026-60004 in its exploited-vulnerability catalog means defenders should prioritize vulnerable installations over ordinary backlog updates.

For organizations running Gitea, the sensible sequence is therefore clear: patch the server, restrict unnecessary registration and repository creation, inspect logs and host activity for signs of exploitation, and rotate credentials if compromise cannot be ruled out. The vulnerability itself has a fix. The harder question is whether an attacker reached the server before that fix was applied.

D

Written by

Daniel Ahmed

I’m interested in cybersecurity, online threats, privacy, and the technologies used to protect digital systems. I enjoy researching vulnerabilities, security incidents, malware, and new defensive techniques. My goal is to explain security issues clearly and share practical information that helps people stay safer online.

37 posts published

All posts by this author

0 Comments

No comments yet. Be the first to share your thoughts.

Join the conversation

Log in or create a free account to leave a comment. You can edit or delete your own comments any time.