/

CVE-2026-107618

Severity:

HIGH RISK

(8.1)

CSRF (CWE-352) in Repository Topics Management Route

CVE-2026-107618

Awaiting Analysis

Vulnerability type

Category:

Cross-Site Request Forgery

CWE:

CWE-352

Impact:

Unauthorized modification of repository topics

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A missing cross-origin request protection check on the repository topics endpoint could allow a malicious website to submit a topic-change request through an authenticated administrator's browser. The issue is risky when a repository administrator visits an attacker-controlled page while an active session is available.

A missing cross-origin request protection check on the repository topics endpoint could allow a malicious website to submit a topic-change request through an authenticated administrator's browser. The issue is risky when a repository administrator visits an attacker-controlled page while an active session is available.

Affected context

The vulnerability occurs on the POST endpoint used to update repository topics. Deployments are exposed when this route is reachable by authenticated repository administrators but is not covered by the middleware or equivalent controls that reject unauthorized cross-origin requests. The described route affects repository topics specifically; other repository settings are not indicated as reachable through it.

The vulnerability occurs on the POST endpoint used to update repository topics. Deployments are exposed when this route is reachable by authenticated repository administrators but is not covered by the middleware or equivalent controls that reject unauthorized cross-origin requests. The described route affects repository topics specifically; other repository settings are not indicated as reachable through it.

Exploit preconditions

  • Attack surface: The POST repository-topics endpoint - Required access: An authenticated browser session belonging to a repository administrator - Trigger point: A repository administrator visits a malicious or otherwise untrusted third-party page - Why exploitation is possible: The endpoint lacks the cross-origin protection normally supplied by sign-in middleware, allowing the browser to send a state-changing request with the administrator's session context
  • Attack surface: The POST repository-topics endpoint - Required access: An authenticated browser session belonging to a repository administrator - Trigger point: A repository administrator visits a malicious or otherwise untrusted third-party page - Why exploitation is possible: The endpoint lacks the cross-origin protection normally supplied by sign-in middleware, allowing the browser to send a state-changing request with the administrator's session context

Why this happens

The route was registered without the middleware responsible for cross-origin request protection. As a result, the application did not adequately verify that a state-changing request originated from a trusted application context. This is a CWE-352 Cross-Site Request Forgery condition, in which an attacker induces a user's authenticated browser to perform an unintended action.

The route was registered without the middleware responsible for cross-origin request protection. As a result, the application did not adequately verify that a state-changing request originated from a trusted application context. This is a CWE-352 Cross-Site Request Forgery condition, in which an attacker induces a user's authenticated browser to perform an unintended action.

Potential impact

  • Repository topics may be changed without the administrator's deliberate action
  • Topic metadata could be altered to misrepresent or disrupt repository organization
  • Automated workflows that consume repository topics could be affected
  • The incident could reduce trust in repository metadata, although the described route does not expose other repository settings
  • Repository topics may be changed without the administrator's deliberate action
  • Topic metadata could be altered to misrepresent or disrupt repository organization
  • Automated workflows that consume repository topics could be affected
  • The incident could reduce trust in repository metadata, although the described route does not expose other repository settings

General mitigation guidance

Mitigation generally involves applying consistent cross-origin request protection to every state-changing route, including routes added outside the default authentication flow. Common defensive patterns include requiring server-validated anti-CSRF tokens, enforcing appropriate Origin or Referer checks where suitable, and using secure session-cookie attributes as a complementary control. State-changing operations should not rely solely on ambient browser credentials, and authorization checks should remain enforced for the targeted repository. Route registration and middleware policies should fail closed when protection is absent.

Mitigation generally involves applying consistent cross-origin request protection to every state-changing route, including routes added outside the default authentication flow. Common defensive patterns include requiring server-validated anti-CSRF tokens, enforcing appropriate Origin or Referer checks where suitable, and using secure session-cookie attributes as a complementary control. State-changing operations should not rely solely on ambient browser credentials, and authorization checks should remain enforced for the targeted repository. Route registration and middleware policies should fail closed when protection is absent.

How teams detect issues like this

Detection can include static analysis and route-mapping checks that identify POST, PUT, PATCH, or DELETE handlers lacking anti-CSRF middleware or equivalent origin validation. Code reviews should examine every state-changing endpoint, especially newly registered routes and handlers that mutate repository metadata. Integration tests can submit cross-origin requests with an authenticated session and verify rejection, while policy enforcement can require documented protection for all browser-accessible state changes.

Detection can include static analysis and route-mapping checks that identify POST, PUT, PATCH, or DELETE handlers lacking anti-CSRF middleware or equivalent origin validation. Code reviews should examine every state-changing endpoint, especially newly registered routes and handlers that mutate repository metadata. Integration tests can submit cross-origin requests with an authenticated session and verify rejection, while policy enforcement can require documented protection for all browser-accessible state changes.

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-28.2.0/
github.comgithub.com/go-gitea/gitea/pull/39839
github.comgithub.com/go-gitea/gitea/pull/39847
github.comgithub.com/go-gitea/gitea/releases/tag/v28.2.0
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-4jmf-h2cm-hg7w

Frequently asked

questions

It can be triggered remotely through a malicious webpage, but exploitation generally depends on an authenticated repository administrator visiting that page while an active session is available.

Not necessarily. The attacker primarily needs to induce a suitably privileged authenticated user's browser to send the request; the browser may supply the existing session context.

Ensure every browser-accessible state-changing route uses server-validated anti-CSRF protection or an equivalent, consistently enforced cross-origin request policy.

Maintain centralized middleware defaults, require security review for route registration, test cross-origin behavior in CI, and enforce policies that prevent unprotected state-changing endpoints.

It can be triggered remotely through a malicious webpage, but exploitation generally depends on an authenticated repository administrator visiting that page while an active session is available.

Not necessarily. The attacker primarily needs to induce a suitably privileged authenticated user's browser to send the request; the browser may supply the existing session context.

Ensure every browser-accessible state-changing route uses server-validated anti-CSRF protection or an equivalent, consistently enforced cross-origin request policy.

Maintain centralized middleware defaults, require security review for route registration, test cross-origin behavior in CI, and enforce policies that prevent unprotected state-changing endpoints.

Find out what's already
exploitable in your codebase.