Skip to content

Cross-Site Request Forgery on `POST /{owner}/{repo}/topics`

This report was submitted with AI assistance

Low
bircni published GHSA-4jmf-h2cm-hg7w Oct 18, 2026

Package

gomod gitea.dev (Go)

Affected versions

<= 28.1.0

Patched versions

28.2.0

Description

Summary

Gitea protects state-changing web routes against cross-site requests in crossOriginProtection.Check (web.go:218-223). That check runs inside the sign-in middleware (verifyAuthWithOptionsWeb, through reqSignIn/optSignIn).

The repository-topics route is registered in a group with context.RepoAssignment, reqRepoAdmin but without any sign-in middleware. The cross-origin check therefore never runs, so a cross-site POST carrying the victim's session cookie is accepted. Sibling routes such as /action/star are correctly rejected with 403.

Details

the source location should be routers/web/web.go:1524-1526

Impact

  • A malicious or compromised website can silently overwrite or clear the topics of any repository whose admin visits it while logged in to Gitea.
  • This enables defacement, misleading search and discovery results (for example tagging a repo as "malware" or adding SEO spam), and wiping curated topic sets.
  • The impact is limited to integrity of the topics field, with no data disclosure.

Severity

Low

CVE ID

CVE-2026-107618

Weaknesses

No CWEs

Credits