# CVE-2026-60004: Gitea Code Injection

> Attackers can achieve remote code execution in Gitea by exploiting the diffpatch API to install malicious Git hooks.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 25 Aug 2026 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Aug 2026
- **Updated:** 8 Sep 2026
- **Also known as:** BIT-gitea-2026-60004, GHSA-rcr6-4jqh-j84m, GO-2026-6433, MINI-252m-7m6c-8xmj, MINI-rx98-74qr-5jgg

## What is CVE-2026-60004?

CVE-2026-60004 is a critical code injection vulnerability in Gitea Gitea, published on 26 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Gitea before 1.27.1 allows remote code execution via the diffpatch API through Git hook installation.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2026-60004?

5 open source packages ship an affected version, including gitea.dev, gitea and code.gitea.io/gitea. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gitea.dev` | Go | All versions | 1.27.1 |
| `gitea.dev` | Go | From 1.17.0 | 1.27.1 |
| `gitea.dev` | Go | From 1.17.0 | 1.27.1 |
| `gitea` | Bitnami | From 1.17.0 | 1.27.1 |
| `code.gitea.io/gitea` | Go | From 1.17.0 | None |

Products: Gitea Gitea.

## How do I fix CVE-2026-60004?

Upgrade gitea.dev to 1.27.1 or later. US federal agencies must fix it by 28 Aug 2026.

## Is CVE-2026-60004 being exploited?

Yes. Attackers have exploited CVE-2026-60004 in the wild since at least 25 Aug 2026.

Public exploit code:

- CVE-2026-60004 Pre-Auth RCE Exploit — Gitea <= 1.27.0 diffpatch git hook injection (CVSS 9.8) (github_poc): https://github.com/imbas007/CVE-2026-60004-POC
- CVE-2026-60004 (github_poc): https://github.com/0xredash/CVE-2026-60004
- CVE-2026-60004 (github_poc): https://github.com/HORKimhab/CVE-2026-60004
- Gitea diffpatch RCE (CVE-2026-60004) PoC - repo-write to RCE as Gitea service account (github_poc): https://github.com/HackSpeak/CVE-2026-60004
- CVE-2026-60004 — Gitea Pre-Auth RCE via diffpatch hook injection (github_poc): https://github.com/gagaltotal/CVE-2026-60004-poc-gitea
- Gitea diffpatch RCE (github_poc): https://github.com/EQSTLab/CVE-2026-60004

## Other vulnerabilities in Gitea Gitea

- [CVE-2026-73278](https://insights.sbomify.com/CVE-2026-73278/): Gitea WebAuthn bypass during OAuth and OIDC sign-in (critical 9.8)
- [CVE-2026-94205](https://insights.sbomify.com/CVE-2026-94205/): Gitea fork workflow approval bypass through maintainer-triggered events (critical 9.8)
- [CVE-2022-42968](https://insights.sbomify.com/CVE-2022-42968/): Gitea vulnerable to Argument Injection (critical 9.8)
- [CVE-2021-45330](https://insights.sbomify.com/CVE-2021-45330/): Improper Privilege Management in Gitea (critical 9.8)
- [CVE-2021-45331](https://insights.sbomify.com/CVE-2021-45331/): Reuse of one time passwords allowed in Gitea (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-60004 and fix it if it is affected.

What it is: CVE-2026-60004 is a critical code injection vulnerability in Gitea Gitea, published on 26 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2026-60004 in the wild since at least 25 Aug 2026.

Affected packages and fixed versions:
- gitea.dev (Go): affected all versions; fixed in 1.27.1
- gitea.dev (Go): affected from 1.17.0; fixed in 1.27.1
- gitea.dev (Go): affected from 1.17.0; fixed in 1.27.1
- gitea (Bitnami): affected from 1.17.0; fixed in 1.27.1
- code.gitea.io/gitea (Go): affected from 1.17.0; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-60004/ (Markdown: https://insights.sbomify.com/CVE-2026-60004/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-60004
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-60004
- OSV: https://osv.dev/vulnerability/CVE-2026-60004

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-60004/
Summaries are generated and may contain mistakes; the official description above is the record.
