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-107618 Overview
CVE-2026-107618 is a Cross-Site Request Forgery (CSRF) vulnerability in Gitea, the self-hosted Git service. The POST /{owner}/{repo}/topics route was registered without the sign-in middleware that enforces cross-origin protection. As a result, Gitea did not reject topic-modification requests originating from third-party sites. A repository administrator who visited a malicious page while authenticated could have the topics of their repository altered without consent. The scope of the flaw is limited: no other repository settings were reachable through this route. Gitea addressed the issue in version 28.2.0.
Critical Impact
Authenticated repository administrators visiting attacker-controlled pages could have repository topics silently modified via forged cross-origin POST requests.
Affected Products
- Gitea versions prior to 28.2.0
- Self-hosted Gitea instances exposing the /{owner}/{repo}/topics endpoint
- Any Gitea deployment accessible to authenticated repository administrators
Discovery Timeline
- 2026-10-18 - CVE-2026-107618 published to NVD
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-107618
Vulnerability Analysis
The vulnerability resides in Gitea's HTTP route registration logic. The POST /{owner}/{repo}/topics handler was wired into the router without the standard sign-in middleware stack. That middleware chain normally includes CSRF token verification tied to the session cookie. Without it, Gitea accepted requests that lacked the expected anti-CSRF token and originated from arbitrary origins.
An attacker hosting a malicious web page could craft an HTML form or JavaScript request targeting the Gitea instance. If a repository administrator visited the page while logged into Gitea, the browser automatically attached the session cookie. Gitea processed the request as legitimate and updated the repository's topic metadata.
The impact is bounded. The route only manipulates repository topics — labels used for discoverability. No code, permissions, visibility, or branch protection settings were reachable through this endpoint.
Root Cause
The root cause is a missing middleware registration during route setup. The topics endpoint bypassed the authenticated session guard that supplies CSRF validation, leaving it reachable by cross-origin POSTs that carried valid session cookies. This is a classic Cross-Site Request Forgery weakness [CWE-352] produced by inconsistent middleware application across similar administrative routes.
Attack Vector
Exploitation requires a victim who is an authenticated Gitea repository administrator and who visits an attacker-controlled page in the same browser session. The attacker's page issues a POST request to the victim's Gitea instance targeting /{owner}/{repo}/topics with crafted topic values. Because the sign-in middleware was absent, Gitea processed the request and persisted the attacker-chosen topics. No user interaction beyond page visitation is required, and no privilege escalation occurs beyond what the victim already holds. See the GitHub Security Advisory GHSA-4jmf-h2cm-hg7w for upstream analysis.
Detection Methods for CVE-2026-107618
Indicators of Compromise
- Unexpected changes to repository topic metadata in Gitea audit logs or repository history
- POST requests to /{owner}/{repo}/topics with Origin or Referer headers pointing to external domains
- Topic modifications timestamped shortly after administrators browsed external links
Detection Strategies
- Review web server and reverse proxy logs for POST requests to the topics endpoint originating from non-Gitea Referer headers
- Correlate repository topic change events with the authenticated user's active session and prior browsing context
- Alert on topic modifications performed outside expected administrative workflows or automation accounts
Monitoring Recommendations
- Enable verbose access logging on the Gitea reverse proxy and retain Origin, Referer, and session identifiers
- Baseline normal topic-change frequency per repository and flag anomalous bursts
- Forward Gitea application logs to a central SIEM for cross-referencing against user activity timelines
How to Mitigate CVE-2026-107618
Immediate Actions Required
- Upgrade Gitea to version 28.2.0 or later, which applies the sign-in middleware to the topics route
- Audit recent repository topic changes for unauthorized modifications and restore legitimate values
- Instruct repository administrators to log out of Gitea when browsing untrusted sites until patching is complete
Patch Information
Gitea released the fix in version 28.2.0. The patch is documented in the Gitea Release Announcement 28.2.0, the Gitea Release Notes v28.2.0, and the upstream code changes in Gitea Pull Request #39839 and Gitea Pull Request #39847. The fix adds the missing authenticated-session middleware so the route rejects cross-origin requests lacking a valid CSRF token.
Workarounds
- Place Gitea behind a reverse proxy rule that drops POST requests to /*/*/topics when the Referer or Origin header does not match the Gitea host
- Enforce SameSite=Strict on the Gitea session cookie to limit cookie attachment on cross-site requests
- Restrict administrative access to Gitea through a VPN or IP allowlist to reduce exposure during unpatched windows
# Example nginx snippet to block cross-origin POSTs to the topics endpoint
location ~ ^/[^/]+/[^/]+/topics$ {
if ($request_method = POST) {
if ($http_origin !~* "^https://gitea\.example\.com$") {
return 403;
}
}
proxy_pass http://gitea_backend;
}
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

