
CVE-2026-60004 — Gitea Pre-Auth RCE via diffpatch hook injection
This repository contains a proof-of-concept tool for CVE-2026-60004, an authenticated or pre-auth remote code execution (RCE) vector affecting certain Gitea versions via the diffpatch hook injection technique. The primary implementation is a single Go program that performs detection and exploitation flows.
This PoC demonstrates exploitation techniques that can compromise remote systems. It is provided for research, testing, and defensive purposes only. Do not run this tool against systems you do not own or do not have explicit permission to test. The author and contributors are not responsible for misuse.
From the repository root run:
go build -o cve-2026-60004-poc cve-2026-60004-poc.go
The compiled binary supports multiple modes: full-auto, semi-auto, manual, and check.


./cve-2026-60004-poc --url http://target:3000 --mode check
./cve-2026-60004-poc --url http://target:3000 --mode full-auto
./cve-2026-60004-poc --url http://target:3000 --mode semi-auto --user attacker --pw 'P@ssw0rd'
./cve-2026-60004-poc --url http://target:3000 --mode manual --user attacker --pw 'P@ssw0rd' --repo myrepo
./cve-2026-60004-poc --url http://target:3000 --mode manual --user attacker --pw 'P@ssw0rd' --repo myrepo --cmd "whoami; id"
--url (required) : Target Gitea base URL (e.g. http://10.0.0.1:3000)--mode : full-auto | semi-auto | manual | check (default: full-auto)--user, --pw : Credentials for semi-auto/manual modes--repo : Repository name (for manual mode)--branch : Branch name (default: main)--cmd : Command to execute on target (default: cat /etc/passwd)check mode runs non-intrusive checks to detect Gitea and probe the presence of the diffpatch endpoint.full-auto tries to register a new user (requires open registration), create a repository, deliver the malicious diffpatch payload, and retrieve output from the injected hook.semi-auto uses supplied credentials to create a repository and proceed with exploitation steps.manual requires an existing user and repository; it only attempts exploit delivery and (optionally) output retrieval.InsecureSkipVerify to true for TLS connections to maximize compatibility during testing; do not use this behavior in production code./api/v1/version, /user/sign_up, /api/v1/user, /api/v1/user/repos, and /api/v1/repos/:owner/:repo/diffpatch.Contributions should be limited to defensive improvements, documentation, and non-exploit-related fixes. Do not submit modifications that make the tool more destructive.
This repository is provided for research and defensive purposes. No license is explicitly included; if you require a license, add one and ensure it is compatible with your intended use.
Author: Gagaltotal666 - GhostGTR666
This PoC was prepared to demonstrate the vulnerability and to assist defenders in detecting and mitigating it.
--count : Number of diffpatch requests to send (min 2)--simple-hook : Use a simple hook (skips advanced payload)--no-retrieve : Skip output retrieval--proxy : HTTP proxy (e.g. http://127.0.0.1:8080)--verbose, -v : Verbose output--quiet, -q : Quiet mode; only print command output--force : Skip Gitea validation checks