CVE-2026-60004
Published:July 28, 2026
Updated:August 02, 2026
Gitea's diffpatch endpoint can be abused to install and execute a Git hook from repository-controlled content. services/repository/files/patch.go applies attacker-controlled patches in a shared bare temporary clone using 'git apply --index --recount --cached --binary', adding the '-3' three-way fallback when Git 2.32 or later is present. Submitting the same patch twice creates an add/add collision, and Git's three-way fallback checks the indexed path out even though the operation is performed with --cached. Because the clone is bare, the repository root is GIT_DIR, so an executable entry named hooks/post-index-change becomes a live Git hook which Git invokes while writing the index. An attacker with ordinary write access to a repository can therefore execute arbitrary shell commands as the Gitea OS user; with default open registration an unauthenticated visitor can obtain the required write access by registering an account and creating a repository. Affects Gitea 1.17 and later before 1.27.1.
Affected Packages
https://github.com/go-gitea/gitea.git (GITHUB):
Affected version(s) >=v1.17.0 <v1.27.1Fix Suggestion:
Update to version v1.27.1gitea.dev (GO):
Affected version(s) >=v1.27.0-rc0 <v1.27.1Fix Suggestion:
Update to version v1.27.1github.com/go-gitea/gitea (GO):
Affected version(s) >=v1.17.0 <v1.27.1Fix Suggestion:
Update to version v1.27.1code.gitea.io/gitea (GO):
Affected version(s) >=v1.17.0 <v1.27.1Fix Suggestion:
Update to version v1.27.1Related Resources (6)
Do you need more information?
Contact UsCVSS v4
Base Score:
9.3
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
9.8
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
Improper Control of Generation of Code ('Code Injection')