Severity by source
AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Network-reachable web UI (AV:N/AC:L); attacker needs a push-capable account, easily met by forking (PR:L); victim must open the preview (UI:R); XSS crosses into victim session (S:C) yielding full account takeover (C:H/I:H, A:N).
Primary rating from Vendor (https://github.com/go-gitea/gitea).
CVSS VectorVendor: https://github.com/go-gitea/gitea
Lifecycle Timeline
2DescriptionCVE.org
Summary
Me again.
Gitea's built-in 3D file viewer (powered by Online3DViewer) is vulnerable to stored cross-site scripting (XSS) through crafted .gltf files. When a glTF file declares an unsupported required extension, Online3DViewer generates an error message containing the extension name and Gitea inserts it into the DOM using innerHTML without sanitization. An attacker who can push a .gltf file to any repository can execute arbitrary JavaScript in the context of any user who views the file.
Affected Versions
- Gitea 1.25.0 and later (3D file preview was introduced in 1.25 via the Online3DViewer integration)
- Confirmed on
gitea:1.25-nightly(SHAe33d1da...), which bundlesonline-3d-viewernpm package v0.16.0 - The upstream Online3DViewer library is the root cause
Severity
- Stored XSS: the payload persists in the repository and fires on every page view
- Executes under the Gitea origin with the victim's session (cookies, CSRF tokens)
- Any authenticated user viewing the file is compromised
- Enables full account takeover (token creation, settings modification, repository manipulation)
- No user interaction beyond viewing the file page is required
Details
Root Cause
When Online3DViewer parses a glTF file, it checks whether all extensionsRequired entries are supported. For unsupported extensions, it calls:
// In the Online3DViewer bundle (online-3d-viewer.js)
// Approximate offset 1142618 in the bundled chunk
this.SetError(yp("Unsupported extension: {0}.", unsupportedExtensions.join(", ")));The SetError method stores this message, and Gitea's rendering code inserts it into the page using innerHTML:
// Gitea's error display handler
element.innerHTML = errorMessage; // unsanitizedThe extension names from extensionsRequired are taken directly from the JSON file with no escaping or sanitization, allowing HTML injection.
Attack Vector
- An attacker creates a
.gltffile with a maliciousextensionsRequiredvalue:
{
"asset": {"version": "2.0"},
"buffers": [],
"extensionsRequired": ["<img src=x onerror=\"alert(document.cookie)\">"],
"scenes": []
}- The attacker pushes this file to any Gitea repository they have write access to (including forks of public repositories).
- When any user navigates to the file's page in the Gitea web UI, the 3D viewer attempts to render it, encounters the "unsupported extension," and inserts the error message (containing the attacker's HTML) into the DOM via
innerHTML. - The injected
<img onerror>handler executes arbitrary JavaScript under the Gitea origin with the victim's authenticated session.
Impact
From the XSS context, an attacker can:
- Create API access tokens for the victim by POSTing to
/user/settings/applicationswith the page's CSRF token - Read private repositories via same-origin API calls
- Modify repository contents (supply chain attacks)
- Escalate to admin if the victim is a Gitea administrator
- Exfiltrate data via
fetch,XMLHttpRequest, ornavigator.sendBeacon
Proof of Concept
Minimal PoC (alert box)
Save as poc.gltf and push to any Gitea 1.25+ repository:
{
"asset": {"version": "2.0"},
"buffers": [],
"extensionsRequired": ["<img src=x onerror=\"alert('XSS: '+document.domain)\">"],
"scenes": []
}Navigate to the file in the Gitea web UI. The alert will fire.
Suggested Fixes
Sanitize or text-encode the error message before DOM insertion. Replace innerHTML with textContent for error display:
// Instead of:
element.innerHTML = errorMessage;
// Use:
element.textContent = errorMessage;Alternatively, escape HTML entities in the error message before insertion.
Additional hardening
- Render 3D file previews inside a sandboxed
<iframe>withsandbox="allow-scripts"and a restrictive CSP (default-src 'none'), similar to how Gitea already handles SVG attachments - Apply Content-Security-Policy headers to file preview pages that restrict inline script execution
Articles & Coverage 1
AnalysisAI
Stored cross-site scripting in Gitea 1.25.x affects the built-in 3D file viewer (Online3DViewer integration) where a crafted .gltf file with an unsupported extension name in extensionsRequired is rendered into the DOM via innerHTML without sanitization. Any low-privileged user who can push a file to a repository (including a public fork) can compromise the session of any user who later views the file, enabling token theft and full account takeover. Publicly available exploit code exists (a working PoC is included in the GHSA-9cpj-qc93-vw8v advisory); no public exploit identified at time of analysis in CISA KEV.
Technical ContextAI
Gitea (pkg:go/code.gitea.io_gitea) introduced 3D model previews in 1.25 by bundling the Online3DViewer JavaScript library (npm package online-3d-viewer 0.16.0). When the library parses a glTF JSON document and finds an entry in extensionsRequired that it does not implement, it builds the message 'Unsupported extension: {names}' via SetError and Gitea's preview wrapper writes that string into the page using element.innerHTML. Because the extension names come straight from attacker-controlled JSON with no HTML escaping, this is a classic CWE-79 (Improper Neutralization of Input During Web Page Generation) sink - an HTML fragment supplied by the file flows directly into the live DOM of the Gitea origin.
RemediationAI
Vendor-released patch: upgrade Gitea to 1.26.0 or later, which is the fixed version called out in GHSA-9cpj-qc93-vw8v (https://github.com/go-gitea/gitea/security/advisories/GHSA-9cpj-qc93-vw8v). If you cannot upgrade immediately, disable the 3D file preview / Online3DViewer integration so .gltf, .glb and related model files fall back to raw download - this removes the sink at the cost of losing in-browser model rendering. As a defense-in-depth measure, serve repository preview pages with a strict Content-Security-Policy that forbids inline event handlers and inline script (default-src 'none' with explicit allowlists), and consider isolating model previews inside a sandboxed iframe (sandbox='allow-scripts' only) the same way Gitea already renders SVG attachments; this blunts the impact but does not fix the underlying innerHTML sink. Restricting who can push to public/fork repositories on the instance further reduces the attack surface but does not eliminate it because forking is normally a self-service feature.
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic
The AES-NI implementation in OpenSSL before 1.0.1t and 1.0.2 before 1.0.2h does not consider memory allocation during a
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-41642
GHSA-9cpj-qc93-vw8v