Skip to main content
Mallory
← Back to News
internet-facing-service-vulnerabilitywidely-deployed-product-advisoryremote-access-implant

Critical Gitea RCE Lets Repository Writers Execute Shell Commands via Git Hooks

Vulnerability Disclosure · 6 sources · Updated 3mo ago · First seen Jul 29, 2026

Critical Gitea RCE Lets Repository Writers Execute Shell Commands via Git Hooks

Gitea has patched a critical remote code execution flaw, CVE-2026-60004, affecting versions 1.17 through 1.27.0, after researchers showed that attacker-controlled patch content sent to the POST /api/v1/repos/{owner}/{repo}/diffpatch endpoint could be turned into a malicious Git hook and executed as the Gitea service account. The bug carries a CVSS 9.8 rating and stems from patch application inside a shared bare temporary clone, where Git's three-way fallback can activate the planted hook; exploitation also depends on Git 2.32 or later. Gitea fixed the issue in version 1.27.1 and said its cloud instances would be upgraded automatically.

Why it matters

Impact assessment

CVE-2026-60004 is a critical Gitea server-side remote code execution issue that affects organizations running self-hosted Gitea versions 1.17 through 1.27.0, especially internet-exposed instances with open self-registration enabled. The impact is severe because successful exploitation yields shell command execution as the Gitea service account and can expose source code, secrets, database credentials, OAuth tokens, and potentially downstream build and supply-chain artifacts.

The exposure is broad across self-hosted Gitea deployments but exploitation is most practical on publicly accessible instances where attackers can self-register and create repositories. Public reporting states no confirmed in-the-wild exploitation as of late July 2026, but public proof-of-concept details exist, which materially raises near-term exploitation risk.

Affected populations

  • Organizations using self-hosted Gitea for source control, issue tracking, and code review
  • Development, DevOps, CI/CD, and software supply-chain environments
  • Public-facing Gitea instances with open registration enabled
  • Any deployment where users have repository write access

Severity and business impact

  • Remote code execution as the operating system account running Gitea
  • Exposure of app.ini, application secrets, environment variables, mounted repositories, database credentials, OAuth tokens, and integration credentials
  • Potential tampering with repositories, build outputs, and downstream artifacts
  • Risk of lateral movement to reachable internal services depending on host isolation and service account privileges
  • Operational disruption from server compromise, repository integrity loss, and incident response requirements

Scope and exploitation status

  • Affects Gitea versions 1.17 through 1.27.0 inclusive
  • Gitea Cloud instances were reported to be upgraded automatically
  • Publicly accessible deployments are at highest risk if registration is open and diffpatch is enabled
  • No confirmed exploitation in the wild was reported in the cited sources, but public PoC and detection content are available
Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

4 events · Jul 29, 2026 – Aug 26, 2026
  1. Aug 26, 20263mo ago

    MITRE publishes CVE-2026-60004 record for Gitea RCE

    MITRE published and updated the CVE-2026-60004 record, classifying the Gitea diffpatch API Git-hook issue as CWE-94 code injection with a CVSS v3.1 score of 9.8. The record states that Gitea versions 1.17 through before 1.27.1 are affected and that 1.27.1 fixes the issue.

    CVE Record: CVE-2026-60004
  2. Reported Aug 2, 20264mo ago

    Nuclei detection template for CVE-2026-60004 is added and corrected

    A ProjectDiscovery Nuclei template for detecting CVE-2026-60004 in Gitea was developed and then corrected after false positives were found on patched versions. The update consolidated matcher conditions with && and added flow logic so the sign-up page check runs only after a vulnerable version is identified.

    CVE 2026 60004 gitea diffpatch rce by FLX-0x00 · Pull Request #16723 · projectdiscovery/nuclei-templates · GitHub
  3. Jul 29, 20264mo ago

    Public proof-of-concept code for CVE-2026-60004 is available

    Public proof-of-concept exploit code exists for the Gitea vulnerability, increasing the risk of exploitation on exposed instances. Gitea's advisory said it had not observed in-the-wild exploitation as of July 29, 2026.

    New Gitea RCE Lets Repository Writers Plant a Git Hook to Run Shell Commands
  4. Jul 29, 20264mo ago

    Gitea fixes CVE-2026-60004 in version 1.27.1

    Gitea patched a critical remote code execution vulnerability, CVE-2026-60004, affecting versions 1.17 through 1.27.0/ before 1.27.1. The flaw allows a repository writer to turn crafted patch content into a malicious Git hook and execute shell commands as the Gitea service account.

    New Gitea RCE Lets Repository Writers Plant a Git Hook to Run Shell Commands
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, breaches, and observables Mallory has linked to this story. Indicator values are masked here and available in full in the app.

Open in app →

Affected products

1 linked
Gitea

Organizations

1 linked
Gitea

Observables

4 linked

Indicator values are masked on this page. See the values in Mallory Domains, IPs, hashes, and URLs are exportable to your SIEM.

Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.