/

CVE-2026-28737

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) via glTF viewer in Gitea

CVE-2026-28737

Deferred

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting in Web UI

Severity:

HIGH RISK

(8.7)

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

Gitea versions from 1.25.0 before 1.26.0 contain a stored cross-site scripting vulnerability in the 3D file viewer when rendering glTF files.

Malicious content in the extensionsRequired field can be executed in a visitor's browser, making repository browsing risky when untrusted glTF assets are present.

Affected context

This vulnerability appears in Gitea instances that use the built-in 3D file viewer to render glTF assets directly in the web interface.

It becomes relevant when users can upload or push glTF files containing crafted data in the extensionsRequired field, and other users or administrators later view these files through the Gitea UI.

Multi-user environments with shared repositories, public projects, or integrations that automatically render 3D assets are most exposed to the risk of stored script execution.

Exploit preconditions

  • Attack surface: Gitea web interface, specifically the 3D file viewer for glTF files.
  • Required access: Ability to push or upload glTF files into a repository that is later viewed via the browser (e.g., valid user account or compromised pipeline).
  • Trigger point: A victim navigates to a repository page where the vulnerable 3D viewer renders a crafted glTF file containing malicious data in extensionsRequired.
  • Why exploitation is possible: The 3D viewer mishandles glTF metadata, allowing untrusted data from extensionsRequired to be interpreted in a way that leads to script injection without proper sanitization or encoding.

Why this happens

The issue stems from insufficient validation and output encoding of glTF metadata fields before they are incorporated into the DOM or client-side rendering logic.

Data from the extensionsRequired field, which should be treated as plain, inert configuration metadata, is instead processed in a manner that allows embedded script-like content to influence the rendered page.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, where untrusted input is not correctly sanitized or escaped before being used in a web context.

Potential impact

  • Attackers may execute arbitrary JavaScript in the context of the Gitea domain.
  • Malicious scripts could steal session cookies or tokens associated with the Gitea instance.
  • User accounts can be targeted with phishing overlays or deceptive UI modifications.
  • Repository integrity and project workflows may be impacted through unauthorized actions performed via the victim's browser.
  • The vulnerability could be chained with other issues to escalate access or pivot into more sensitive areas of the environment.

General mitigation guidance

Effective mitigation focuses on treating all glTF metadata as untrusted input and ensuring it cannot directly influence script execution.

Common defensive patterns include:

  • Applying strict HTML and JavaScript output encoding to any data surfaced from glTF files before inserting it into the DOM.
  • Enforcing rigorous input validation on glTF fields, rejecting or stripping unexpected content and limiting allowed characters or structures in extensionsRequired.
  • Isolating 3D rendering logic within sandboxed contexts (such as safe iframes or dedicated viewer components that never interpret metadata as code).
  • Adhering to least-privilege principles for client-side features, avoiding unnecessary dynamic script generation or evaluation in the viewer.
  • Integrating security reviews for custom file viewers and renderers to ensure they conform to secure-by-default patterns.

How teams detect issues like this

Organizations can identify similar vulnerabilities by:

  • Using static analysis rules and linters that flag dynamic DOM insertion, string-based JavaScript construction, or unsanitized template variables within viewer components.
  • Conducting focused code reviews for file rendering pipelines, paying attention to how metadata and content from uploaded artifacts are passed into front-end code.
  • Applying security testing frameworks that simulate XSS payloads in structured file formats (such as glTF) and verify whether the UI safely handles them.
  • Enforcing security policies that require encoding libraries and centralized sanitization utilities for any user-controlled data rendered in the web interface.

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-1.26.0/
github.comgithub.com/go-gitea/gitea/pull/37233
github.comgithub.com/go-gitea/gitea/releases/tag/v1.26.0
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-9cpj-qc93-vw8v

Frequently asked

questions

It can be exploited wherever users can introduce glTF files into repositories and other users or administrators view those files in the Gitea 3D viewer. Multi-user or public instances are particularly exposed.

An attacker generally needs the ability to push or upload a crafted glTF file to a repository. This often means having a valid account or compromising an existing user's credentials or automated integration.

The safest pattern is to ensure that all data from glTF files, including extensionsRequired, is treated as untrusted and is strictly sanitized and output-encoded before rendering, combined with isolating viewer logic so that metadata cannot ever be interpreted as script.

To prevent similar issues, standardize on robust input validation and output encoding for any user-supplied content, subject custom viewers and renderers to security design reviews, and integrate automated checks that detect unsanitized data flows into the front-end.

Find out what's already
exploitable in your codebase.