CVE-2026-20912 Overview
CVE-2026-20912 is an Improper Access Control vulnerability affecting Gitea, the popular self-hosted Git service. The vulnerability exists because Gitea does not properly validate repository ownership when linking attachments to releases. An attachment uploaded to a private repository could potentially be linked to a release in a different public repository, making it accessible to unauthorized users.
This vulnerability represents a significant security concern for organizations using Gitea to host both public and private repositories, as confidential files intended to remain private could be inadvertently exposed through improper attachment linking.
Critical Impact
Unauthorized access to private repository attachments through improper validation of repository ownership when linking attachments to public releases, potentially exposing sensitive or confidential files.
Affected Products
- Gitea versions prior to 1.25.4
Discovery Timeline
- 2026-01-22 - CVE CVE-2026-20912 published to NVD
- 2026-01-22 - Last updated in NVD database
Technical Details for CVE-2026-20912
Vulnerability Analysis
This vulnerability falls under CWE-284 (Improper Access Control), indicating a fundamental flaw in how Gitea enforces authorization boundaries between repositories. The core issue stems from insufficient validation during the attachment linking process for releases.
When a user uploads an attachment to a private repository, that attachment is stored with an identifier. The vulnerability allows an attacker with appropriate permissions to create releases in a public repository to reference and link attachments by their identifiers, even when those attachments belong to a different private repository. This effectively bypasses the intended access control boundaries that should separate content between repositories with different visibility settings.
The impact of this vulnerability is primarily information disclosure. Sensitive files such as proprietary code, configuration files containing credentials, or confidential documentation that were uploaded as attachments to private repositories could be exposed to unauthorized users if an attacker successfully links them to a public release.
Root Cause
The root cause of this vulnerability is a missing or insufficient authorization check in the attachment linking functionality for releases. When an attachment is being linked to a release, the application fails to verify that the attachment belongs to the same repository as the release being created or modified. This allows cross-repository attachment references, which breaks the intended isolation between private and public repository content.
The fix, implemented in Gitea Pull Request #36320 and Pull Request #36355, adds proper ownership validation to ensure that attachments can only be linked to releases within their originating repository.
Attack Vector
An attacker with the ability to create releases in a public Gitea repository could exploit this vulnerability by:
- Identifying or guessing attachment identifiers from a target private repository
- Creating a new release in a public repository they control
- Linking the private repository's attachment to the public release
- The attachment becomes accessible through the public repository's release page
This attack requires the attacker to have knowledge of valid attachment identifiers and the ability to create releases. The vulnerability could be particularly dangerous in multi-tenant Gitea instances where attackers might have legitimate accounts but should not have access to certain private repositories.
Detection Methods for CVE-2026-20912
Indicators of Compromise
- Unexpected attachments appearing in release assets that were not uploaded directly to that repository
- Audit logs showing release creation or modification events with attachment references to identifiers outside the repository's scope
- User reports of private files becoming publicly accessible through unexpected channels
Detection Strategies
- Review release audit logs for cross-repository attachment references
- Monitor for unusual patterns of release creation followed by attachment linking operations
- Implement alerts for releases containing attachments with identifiers not associated with the repository
- Conduct periodic audits comparing attachment ownership against release associations
Monitoring Recommendations
- Enable detailed logging for release and attachment operations in Gitea
- Configure alerts for anomalous attachment linking behavior across repository boundaries
- Review access logs for private attachment files being accessed through public release URLs
- Implement file integrity monitoring for attachment storage directories
How to Mitigate CVE-2026-20912
Immediate Actions Required
- Upgrade Gitea to version 1.25.4 or later immediately
- Audit existing releases for any suspicious cross-repository attachment links
- Review private repositories for any attachments that may have been exposed
- Restrict release creation permissions to trusted users until patching is complete
Patch Information
Gitea has released version 1.25.4 which addresses this vulnerability. The fix ensures proper validation of repository ownership when linking attachments to releases, preventing cross-repository attachment exposure.
For detailed information about the security fix, refer to:
The fix was implemented through Pull Request #36320 and Pull Request #36355.
Workarounds
- Limit release creation permissions to only highly trusted users until the patch can be applied
- Audit and review existing releases for any potentially compromised attachments
- Consider temporarily disabling attachment functionality for releases if immediate patching is not possible
- Implement network-level access controls to restrict access to Gitea instances containing sensitive private repositories
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


