CVE-2026-96594

Gitea repository media API stored XSS

Published Oct 6, 2026 CVSS 3.1 · 6.1 Medium EPSS < 1% KEV · Not listed
Description
The Gitea API endpoint `GET /api/v1/repos/{owner}/{repo}/media/{filepath}` wrote files of up to 1 KiB that are stored directly in Git, not in LFS, to the response without the content type and disposition headers Gitea uses for user content. An HTML file committed to a repository was therefore rendered by the browser on the Gitea origin. A user who can push to a repository could run JavaScript in the session of a victim who opens the media URL and act with the victim's permissions.

Analysis

AI-generated

Technical impact

The vulnerable API endpoint serves files up to 1 KiB from Git directly to a browser without setting the expected content type or content disposition headers. A user who can push to a repository can commit an HTML file, which the server then renders as a page. When a victim visits the media URL, the malicious JavaScript executes in that victim’s session, giving the attacker the victim’s browser privileges for the Gitea origin. This is a classic stored XSS flaw where arbitrary code can run with the victim’s credentials.

Affected Systems

All Gitea releases run on the Gitea:Gitea stack are affected; the fix was delivered in release v28.1.0. Specific vulnerable versions are not enumerated in the CVE, but any deployment before that patch is at risk.

Risk and Exploitability

The exploit requires that the attacker have permission to push to a repository and that a victim visits the compromised media URL. The EPSS score is < 1% and the CVSS score is 6.1, while the vulnerability is not listed in CISA KEV. The lack of content headers makes the attack trivial for an attacker who controls repository contents, giving high impact in a collaborative environment. Likely attack vectors involve a supply‑chain or compromised contributor adding malicious HTML to a repo and a user viewing that media resource.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Gitea to v28.1.0 or a later release that sets proper content type and disposition headers for media endpoints.
  • Configure Gitea to enforce MIME type checks or to serve media with a neutral content type such as application/octet-stream to prevent browser rendering of HTML.
  • Limit push access to trusted contributors and audit repositories for embedded HTML or JavaScript before merging changes.

Generated by OpenCVE AI on October 7, 2026 at 18:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:gitea:gitea:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

Type Values Removed Values Added
First Time appeared Gitea
Gitea gitea
Vendors & Products Gitea
Gitea gitea
Type Values Removed Values Added
Description The Gitea API endpoint `GET /api/v1/repos/{owner}/{repo}/media/{filepath}` wrote files of up to 1 KiB that are stored directly in Git, not in LFS, to the response without the content type and disposition headers Gitea uses for user content. An HTML file committed to a repository was therefore rendered by the browser on the Gitea origin. A user who can push to a repository could run JavaScript in the session of a victim who opens the media URL and act with the victim's permissions.
Title Gitea repository media API stored XSS
Weaknesses CWE-79
References
Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
Gitea
Published
Updated
Oct 7, 2026, 3:04 PM
Reserved
Oct 4, 2026, 10:02 PM
Status
Analyzed
Published
Oct 6, 2026, 10:17 PM
Modified
Oct 13, 2026, 5:59 PM