Summary
CVE-2026-95106 is a critical vulnerability in Gitea caused by improper validation of Git tree objects, allowing a Git tree to contain duplicate entries with the same name — a state that Git itself normally rejects. Gitea’s web review interface resolves such a duplicate to the first matching entry, while git checkout, Gitea Actions, and archive generation (git archive) resolve it to the last entry, so the code a reviewer sees and approves is not the code that actually gets executed or shipped. The issue carries a CVSS v3.1 base score of 9.1 (Critical) and affects Gitea instances reachable over the network.
Technical details
- Root cause: Gitea accepts and stores Git tree objects containing two entries with the same file name, a malformed structure that upstream Git’s own consistency checks (
git fsck) normally reject. - Trigger conditions: An attacker with contributor/push access (e.g., submitting a pull request) crafts a commit whose tree contains a duplicate entry — one benign, one malicious — under the same path.
- Resolution mismatch: Gitea’s web UI and code review pages render the first matching tree entry, while
git checkout, Gitea Actions workflow execution, and release/archive generation (git archive) use the last matching entry. - Attack vector: Network — exploited by submitting content through the normal pull request/push workflow of an internet-exposed Gitea instance; no special privileges beyond contributor access are needed to craft the malicious commit.
- Impact: A reviewer approves what appears to be benign code, but Gitea Actions then checks out and executes the attacker’s hidden code using the repository’s CI secrets and tokens. The same primitive can poison release tarballs produced via
git archiveand can mislead any external tool or scanner that reads file content through Gitea’s UI or API. Because the commit SHA is identical between the "reviewed" and "executed" views, the discrepancy does not appear in audit trails that pin to a commit hash.
Affected software
- Gitea versions 0 through 1.27.3 (all releases up to and including 1.27.3)
Severity
- CVSS v3.1 Base Score: 9.1 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Mitigation and recommended actions
- Immediate: Upgrade to Gitea 28.0.0 or later, which enforces Git object consistency checks on incoming pushes and rejects trees containing duplicate entry names.
- If immediate patching is not possible:
- Restrict push/contributor access to trusted users only, and require review of CI workflow changes before merge.
- Treat any Actions runs triggered by externally-contributed pull requests as untrusted, and avoid exposing CI secrets/tokens to workflows triggered by unreviewed contributors.
- Monitor for anomalies between rendered file content and checked-out/archived content where feasible, since commit SHAs will not reveal the discrepancy.

