Skip to content
Security Alerts

CVE-2026-60004: remote code execution in Gitea via the diffpatch endpoint (CISA KEV, due 28 August)

Gitea from 1.17 up to 1.27.1 lets any user with write access to a repository execute shell commands on the server — with open registration enabled, creating an account is enough...

Summary

ParameterValue
CVE IDCVE-2026-60004
Alert SourceCISA KEV - active exploitation
CVE Publication Year2026
Date Published2026-08-25
VendorGitea
ProductGitea
Affected versions>= 1.17, < 1.27.1
Fixed version1.27.1
CVSS Scorenot scored in NVD; GitHub Security Advisory rates it Critical
EPSS ScoreNo data
CISA KEVYes - confirmed active exploitation
RansomwareNot confirmed
Remediation Deadline2026-08-28

Vulnerability Description

Gitea is a self-hosted Git server — the GitLab equivalent for organisations that keep source code on their own infrastructure.

The diffpatch endpoint (services/repository/files/patch.go) applies attacker-controlled patches inside a shared bare temporary clone. Submitting the same patch twice creates an add/add collision; Git’s three-way fallback then checks the indexed path out to disk even though the operation uses --cached. In a bare clone the repository root is $GIT_DIR, so an executable entry named hooks/post-index-change becomes a live Git hook. Git invokes it while writing the index, and repository-controlled content executes as the operating-system account running Gitea.

The attack only needs ordinary write access to one repository. With open registration enabled by default, an unauthenticated visitor obtains that access on their own — register an account, create a repository.

The proof of concept published with the advisory stores command output in Git objects and creates a result branch, so the attack requires no outbound connection from the server — detection based on egress traffic will not see it.

CISA added the vulnerability to the KEV catalog on 25 August 2026 with a remediation deadline of 28 August 2026.

Required Actions

  1. Upgrade Gitea to 1.27.1 or later — this is the only complete fix.
  2. If you cannot upgrade today: disable open registration ([service] DISABLE_REGISTRATION = true in app.ini). It does not remove the vulnerability, but it raises the bar from “anyone on the internet” to “an account holder”.
  3. Restrict public network access to the Gitea instance — VPN or an IP allow list. A Git server holding source code rarely needs to face the whole internet.
  4. Because the flaw is actively exploited, check for compromise: files under repository hooks/ directories (especially post-index-change), unusual processes owned by the Gitea system account, accounts created through self-registration, fresh repositories created by unknown users, and changes to SSH keys and API tokens.
  5. If compromise is confirmed, treat every secret in repositories and CI/CD as disclosed — the Gitea system account can reach the entire repository store.

Who Is Affected?

Organisations running their own Gitea instance. It shows up wherever source code cannot leave the organisation’s infrastructure: public sector, banking and insurance, R&D teams, and software vendors serving customers with on-premise requirements. It is also frequently stood up bottom-up by development teams as a “lightweight GitLab” — and in that case it usually falls outside the asset register covered by vulnerability management.

A Git server is a high-value target: it holds source code, history, deployment configuration and very often secrets. Code execution on that host is equivalent to access to the organisation’s intellectual property and to its software supply chain.

Sources


Need help securing your systems? nFlo team offers vulnerability management and 24/7 SOC services. Contact us.

Learn More

Share:

Talk to an expert

Have questions about this topic? Get in touch with our specialist.

Sales Representative
Grzegorz Gnych

Grzegorz Gnych

Sales Representative

Response within 24 hours
Free consultation
Individual approach

Providing your phone number will speed up contact.

Want to Reduce IT Risk and Costs?

Book a free consultation - we respond within 24h

Response in 24h Free quote No obligations