vulnerability / NVI-00000794 / Revision 4
Gitea: Remote Code Execution via diffpatch Git Hook Installation
GitHub lists this reviewed advisory for gitea.dev. Published version ranges and source prerequisites are shown below; this is not an inspection of a visitor’s application.
This report has not inspected your inventory, configuration, deployed build, reachability or evidence. A catalog listing and a severity score do not establish exposure or compromise.
01 / Meaning
Why it matters
Published affected context helps an owner decide what evidence to gather. This report has not examined your application.
9.8 critical
GitHub source severity; exploitability and local consequence require separate evidence.
As of · GitHub Advisory Database
Listed
CISA lists known exploitation. This does not establish exploitation of your system.
As of · CISA
9.8 CRITICAL (3.1)
cve@mitre.org severity; no combined Null risk score.
23.988%
FIRST EPSS model v2026.06.15; exploitation probability over 30 days, percentile 0.97841. Missing scores are unknown.
As of · FIRST EPSS
02 / Applicability
The affected context
Affected versions, configuration prerequisites and known exclusions are public. Confirm each one against the deployed service.
gitea.dev
source listed>= 1.17.0, < 1.27.1
### Summary Gitea's `diffpatch` endpoint can be abused to install and execute a Git hook from repository-controlled content. An attacker with ordinary write access to a repository can 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. ### Details `services/repository/files/patch.go` applies attacker-controlled patches in a shared bare temporary clone: ```go cmdApply := gitcmd.NewCommand("apply", "--index", "--recount", "--cached", "--binary") if git.DefaultFeatures().CheckVersionAtLeast("2.32") { cmdApply.AddArguments("-3") } ```` Submitting the same patch twice creates an add/add collision. Git's three-way fallback checks the indexed path out even though the operation is performed with `--cached`. In a bare clone, the repository root is `$GIT_DIR`. As a result, an executable entry named: ```text hooks/post-index-change ``` becomes a live Git hook. Git invokes the hook while writing the index, allowing repository-controlled content to execute arbitrary commands as the Gitea service account. The hook's return value is
Gitea Gitea
source listedThe linked source does not supply a complete affected-version range here.
CISA does not supply a complete application-specific affected range here. Follow the linked vendor advisory for version and configuration prerequisites.
03 / Response
What to do next
- investigate
Identify the exact component and deployed version, examine the linked publisher’s conditions, and retain evidence of any mitigation.
Confirm current vendor support, compatibility and deployment evidence. This report has not tested a fix in your system. FIRST EPSS
- investigate
Apply mitigations in accordance with vendor instructions, ensuring compliance with CISA’s BOD 26-04 Prioritizing Security Updates Based on Risk (see URL in Notes) guidance and CISA’s “Forensics Triage Requirements” (see URL in Notes). Follow applicable BOD 26-04 guidance for cloud services or discontinue use of the product if mitigations are unavailable. Stakeholders are responsible for evaluating each asset's internet exposure and ensuring adherence to BOD 26-04 patching guidelines.
Confirm current vendor support, compatibility and deployment evidence. This report has not tested a fix in your system. CISA
A fixed release is not deployment evidence.
Check current vendor support and compatibility. After making a change, verify the deployed build and relevant runtime conditions. Keep the evidence, owner and time. An updated lockfile alone does not prove what is running.
04 / Limits
What this report cannot establish
- Customer inventory, deployment, reachability and exploitation have not been inspected.
- CISA catalog date-added and due-date fields are not the original vulnerability disclosure date or universal legal deadlines.
- NVD lastModified does not establish freshness of every associated CPE record.
05 / Provenance
Sources you can inspect
Each assertion retains its source. Mirrored records may repeat one underlying publisher; additional links are not independent corroboration.
- GHSA-rcr6-4jqh-j84m ↗
GitHub Advisory Database · vendor advisory
Observed . GitHub Advisory Database; CC-BY-4.0. Each advisory links its original attribution. Null normalizes fields.
- CVE-2026-60004 ↗
CISA · official catalog
Observed . CISA KEV; CC0 1.0. Catalog assertions are not evidence of customer compromise.
- CVE-2026-60004 ↗
NIST National Vulnerability Database · official catalog
Observed . This product uses data from the NVD API but is not endorsed or certified by the NVD.
- CVE-2026-60004 ↗
FIRST EPSS · official catalog
Observed . FIRST EPSS; probability of exploitation in the next 30 days, not local compromise. Dataset date/model retained; FIRST services terms apply.
Public revision history
Only published revisions appear here. Routine fetches do not create a material-change event.
- Revision 4 ·
Source facts changed; compare the preserved prior revision.
- Revision 3 ·
Source facts changed; compare the preserved prior revision.
- Revision 1 ·
First indexed by Null; source disclosure date is shown separately.