Skip to main content
Vulnerability Database/CVE-2026-105268

CVE-2026-105268: Gitea Privilege Escalation Vulnerability

CVE-2026-105268 is a privilege escalation flaw in Gitea that allows issue authors to improperly modify or delete attachments from other users' comments. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-105268 Overview

CVE-2026-105268 is an Insecure Direct Object Reference ([CWE-639]) vulnerability in Gitea, a self-hosted Git service. The Gitea API routes for issue attachments at /api/v1/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} incorrectly accepted attachments belonging to comments on the issue. Because the author of an issue can edit and delete attachments on their own issue, an issue author could rename or delete attachments that other users posted in comments on that same issue. The contents of the attachments cannot be modified, limiting the issue to integrity and availability of attachment metadata.

Critical Impact

An issue author can rename or delete attachments uploaded by other users within comments on their issue, enabling unauthorized tampering with user-contributed content.

Affected Products

  • Gitea versions prior to v28.1.0
  • Self-hosted Gitea instances exposing the issue attachment API
  • Gitea API endpoint /api/v1/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}

Discovery Timeline

Technical Details for CVE-2026-105268

Vulnerability Analysis

The vulnerability lies in Gitea's authorization logic for the issue attachment API. The endpoint responsible for operating on an attachment by attachment_id validates that the caller is the issue author but does not confirm the attachment actually belongs to the issue body rather than to a comment under the issue. Attachments on comments are owned by the comment author, who may be a different user. By passing a comment attachment's identifier to the issue attachment route, the issue author gains write operations over an object they do not own. The flaw is classified as Authorization Bypass Through User-Controlled Key ([CWE-639]).

Root Cause

The root cause is a missing ownership check when the API resolves an attachment_id under the issue scope. The handler treats any attachment whose parent issue matches {index} as writable by the issue author, ignoring the distinction between attachments linked to the issue itself and attachments linked to comments under the issue. The GitHub security advisory GHSA-96qg-qxxj-r8xq documents the behavior.

Attack Vector

An authenticated user opens an issue in any repository where other users may comment and upload attachments. When another user posts a comment with an attachment, the issue author retrieves that attachment's ID and issues PATCH or DELETE requests to the issue-scoped attachment endpoint. The server accepts the request based on issue authorship and performs rename or delete operations on the comment attachment. File contents are preserved, but the attachment can be renamed to a misleading value or removed entirely. The vulnerability requires authentication and no user interaction from the victim.

See the Gitea Blog Release Announcement and GitHub Security Advisory GHSA-96qg-qxxj-r8xq for authoritative technical details.

Detection Methods for CVE-2026-105268

Indicators of Compromise

  • Unexpected DELETE or PATCH requests from issue authors to /api/v1/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} targeting attachment IDs that do not belong to the issue body.
  • Comment attachments that have been renamed or removed without a corresponding action by the comment author.
  • Audit log entries showing attachment modifications performed by a user who is not the uploader.

Detection Strategies

  • Review Gitea access logs for API calls to the issue attachment endpoint and correlate the acting user against the attachment's uploader.
  • Query the Gitea database to identify attachments where the last modifier differs from the uploader and where the attachment is linked to a comment.
  • Alert on bulk attachment deletions originating from a single authenticated session.

Monitoring Recommendations

  • Ingest Gitea application and HTTP access logs into a centralized logging platform for retention and correlation.
  • Monitor for anomalous frequency of attachment DELETE or PATCH operations per user per repository.
  • Track user reports of missing or renamed comment attachments and correlate with API activity windows.

How to Mitigate CVE-2026-105268

Immediate Actions Required

  • Upgrade all Gitea instances to Gitea Release v28.1.0 or later.
  • Audit recent attachment modifications on comments to identify unauthorized changes performed before patching.
  • Restrict issue creation and commenting permissions on sensitive repositories until the upgrade is complete.

Patch Information

The fix is included in Gitea v28.1.0. The code changes are published in Pull Request #39501 and Pull Request #39507, which add ownership validation to ensure the targeted attachment belongs to the issue itself rather than to a comment on the issue. Administrators should review the Gitea Blog Release Announcement for upgrade guidance.

Workarounds

  • If immediate upgrade is not possible, restrict API access to the issue attachment endpoint at a reverse proxy layer.
  • Limit repository collaboration to trusted users to reduce the number of parties who can act as issue authors against third-party comment attachments.
  • Enable comprehensive audit logging on the Gitea instance so that any unauthorized attachment modification can be identified and reversed from backups.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.