# CVE-2026-20912: Gitea improper ownership validation in release attachments

Source: https://junglewise.ai/threats/cve-2026-20912-gitea-improper-ownership-validation-in-release-attachments  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-01-22. Updated: 2026-06-27  
License: CC BY 4.0 with a link back

CVE-2026-20912 · Severity: critical · CVSS 9.1 · Published 2026-01-22

Gitea, an open-source platform for hosting software development projects, was found to have a security flaw in how it handles file attachments for software releases. This vulnerability allows an attacker to link a file from a private, restricted repository to a public one, potentially exposing sensitive internal code or data to unauthorized users. Organizations using Gitea should update to version 1.25.4 to ensure private files remain protected.

Technologies: [Gitea](https://junglewise.ai/threats/technologies/gitea), [code.gitea.io/gitea (Go)](https://junglewise.ai/threats/technologies/code-gitea-io-gitea), [github.com/go-gitea/gitea (Go)](https://junglewise.ai/threats/technologies/github-com-go-gitea-gitea). Vendors: [Gitea](https://junglewise.ai/threats/vendors/gitea), [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2026-20912 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-20912 being exploited in the wild.

**How severe is CVE-2026-20912?** Critical severity, with a CVSS score of 9.1, published 22 January 2026.

**Which products and versions are affected?** Gitea < 1.25.4; code.gitea.io/gitea (Go) SEMVER:introduced=0,fixed=1.25.4; github.com/go-gitea/gitea (Go) SEMVER:introduced=0,fixed=1.25.4.

**Is there a fix for CVE-2026-20912?** Yes. code.gitea.io/gitea (Go): upgrade to 1.25.4 or later; github.com/go-gitea/gitea (Go): upgrade to 1.25.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-20912 attacked?** It is attacked over the network, in a network appliance.

**Am I affected by CVE-2026-20912?** Check whether you run Gitea, code.gitea.io/gitea (Go) or github.com/go-gitea/gitea (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- code.gitea.io/gitea (Go): upgrade to 1.25.4 or later

  ```sh
  go get code.gitea.io/gitea@v1.25.4
  ```

- github.com/go-gitea/gitea (Go): upgrade to 1.25.4 or later

  ```sh
  go get github.com/go-gitea/gitea@v1.25.4
  ```


## Technical details

An authorization bypass vulnerability exists in Gitea due to improper validation of repository ownership when linking attachments to releases. The flaw, classified under CWE-284 and CWE-639, allows an attacker to associate an attachment originally uploaded to a private repository with a release in a different, potentially public repository. This occurs because the application does not verify that the attachment and the release belong to the same repository context. An unauthenticated or low-privileged attacker can exploit this to leak sensitive files. The issue is addressed in Gitea version 1.25.4 by implementing stricter ownership checks in the attachment deletion and linking logic.

## Affected products

- Gitea Gitea < 1.25.4
- Red Hat OpenShift Pipelines 1

## Identifiers

- CVE-2026-20912
- GHSA-4xx9-vc8v-87hv
- GO-2026-4364

## Timeline

- 2026-01-07: other: Initial fix developed in Gitea pull request #36320
- 2026-01-22: advisory: Gitea 1.25.4 released with security fixes
- 2026-01-22: disclosed: CVE-2026-20912 published

## References

- [https://blog.gitea.com/release-of-1.25.4/](https://blog.gitea.com/release-of-1.25.4/)
- [https://github.com/go-gitea/gitea/pull/36320](https://github.com/go-gitea/gitea/pull/36320)
- [https://github.com/go-gitea/gitea/pull/36355](https://github.com/go-gitea/gitea/pull/36355)
- [https://github.com/go-gitea/gitea/releases/tag/v1.25.4](https://github.com/go-gitea/gitea/releases/tag/v1.25.4)
- [https://github.com/go-gitea/gitea/security/advisories/GHSA-vfmv-f93v-37mw](https://github.com/go-gitea/gitea/security/advisories/GHSA-vfmv-f93v-37mw)
- [https://access.redhat.com/security/cve/CVE-2026-20912](https://access.redhat.com/security/cve/CVE-2026-20912)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2432219](https://bugzilla.redhat.com/show_bug.cgi?id=2432219)

## Related threats

- [Gitea account takeover via OAuth2 auto-linking](https://junglewise.ai/threats/cve-2026-120263-when-oauth2-client-account-linking-is-set-to-auto-not-the)
- [Gitea limited-visibility profile disclosure via public-only token](https://junglewise.ai/threats/cve-2026-119627-the-web-profile-and-rss-atom-feed-routes-of-users-and)
- [Gitea token scope bypass in web routes](https://junglewise.ai/threats/cve-2026-119625-the-username-web-route-accepted-personal-access-tokens-over-http)
- [Gitea project boards information disclosure of private pull requests](https://junglewise.ai/threats/cve-2026-119533-repository-and-organization-project-boards-listed-the-pull)
- [Gitea API token scope bypass in repository deletion](https://junglewise.ai/threats/cve-2026-119441-delete-api-v1-orgs-org-repos-deletes-all-repositories-of-an)
