# CVE-2026-96594: Gitea stored XSS in media API endpoint

Source: https://junglewise.ai/threats/cve-2026-96594-the-gitea-api-endpoint-get-api-v1-repos-owner-repo-media-filepath  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-06. Updated: 2026-10-06  
License: CC BY 4.0 with a link back

CVE-2026-96594 · Severity: info · Published 2026-10-06

Gitea, a self-hosted Git service, has a vulnerability in its media file API that serves HTML files without proper content-type headers, causing them to render as web pages in the browser. An attacker who can commit code to a repository can exploit this to run malicious JavaScript in the context of other users viewing the file, stealing credentials or performing actions on their behalf.

Technologies: [Gitea](https://junglewise.ai/threats/technologies/gitea). Vendors: [Gitea](https://junglewise.ai/threats/vendors/gitea).

## Quick answers

**Is CVE-2026-96594 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-96594 being exploited in the wild.

**How severe is CVE-2026-96594?** Informational severity, published 6 October 2026.

**Which products and versions are affected?** Gitea prior to 28.1.0.

**Is there a fix for CVE-2026-96594?** Yes: fixed in Gitea 28.1.0. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-96594 attacked?** It is attacked over the network, in a web application.

**Am I affected by CVE-2026-96594?** Check whether you run Gitea at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in Gitea 28.1.0

## Technical details

The GET /api/v1/repos/{owner}/{repo}/media/{filepath} endpoint fails to set appropriate content-type and content-disposition headers when serving small files (≤1 KiB) stored directly in Git rather than Git LFS. This allows an HTML file committed to a repository to be rendered by the browser on the Gitea origin domain, enabling stored XSS. An attacker with push access can exploit this to execute JavaScript in a victim's authenticated session.

## Affected products

- Gitea Gitea prior to 28.1.0

## Timeline

- 2026-10-06: disclosed

## References

- [https://blog.gitea.com/release-of-28.1.0/](https://blog.gitea.com/release-of-28.1.0/)
- [https://github.com/go-gitea/gitea/pull/39501](https://github.com/go-gitea/gitea/pull/39501)

## Related threats

- [Gitea account takeover via OAuth2 auto-linking](https://junglewise.ai/threats/cve-2026-120263-when-oauth2-client-account-linking-is-set-to-auto-not-the)
- [Gitea limited-visibility profile disclosure via public-only token](https://junglewise.ai/threats/cve-2026-119627-the-web-profile-and-rss-atom-feed-routes-of-users-and)
- [Gitea token scope bypass in web routes](https://junglewise.ai/threats/cve-2026-119625-the-username-web-route-accepted-personal-access-tokens-over-http)
- [Gitea project boards information disclosure of private pull requests](https://junglewise.ai/threats/cve-2026-119533-repository-and-organization-project-boards-listed-the-pull)
- [Gitea API token scope bypass in repository deletion](https://junglewise.ai/threats/cve-2026-119441-delete-api-v1-orgs-org-repos-deletes-all-repositories-of-an)
