CVE-2026-28737: Gitea Cross-Site Scripting Vulnerability
HIGHCVE-2026-28737 is a HIGH (CVSS 8.7) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Gitea libraries in the Go ecosystem. The issue involves stored xss via gltf `extensionsrequired` in gitea 3d file viewer. Remediation is available by upgrading affected packages to version 1.26.0.
CVE-2026-28737 at a Glance
Security Impact
CVSS: 8.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N).
How to Fix CVE-2026-28737
To remediate this vulnerability, upgrade all affected Gitea dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade code.gitea.io/gitea to 1.26.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for code.gitea.io/gitea
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-28737, inspect your project dependencies for Gitea:
inspect dependencies for code.gitea.io/gitea
Analyze the terminal output to locate any version of Gitea in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.26.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Gitea, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-28737 Affected Gitea Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
code.gitea.io/gitea
|
Go |
≥ 1.25.0
< 1.26.0
|
1.26.0
|
References
Frequently Asked Questions
What is CVE-2026-28737?
Which Gitea versions are affected?
What version fixes CVE-2026-28737?
Is code.gitea.io/gitea affected?
What is the CVSS score of CVE-2026-28737?
What CWE is associated with CVE-2026-28737?
How can I check Go dependencies for CVE-2026-28737?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9cpj-qc93-vw8v",
"modified" : "2026-06-17T18:10:19Z",
"published" : "2026-06-17T18:10:19Z",
"aliases" : [ "CVE-2026-28737" ],
"summary" : "Gitea: Stored XSS via glTF `extensionsRequired` in Gitea 3D File Viewer",
"details" : "## Summary\n\nMe again.\n\nGitea'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.\n\n## Affected Versions\n\n- Gitea **1.25.0** and later (3D file preview was introduced in 1.25 via the Online3DViewer integration)\n- Confirmed on `gitea:1.25-nightly` (SHA `e33d1da...`), which bundles `online-3d-viewer` npm package v0.16.0\n- The upstream [Online3DViewer](https://github.com/kovacsv/Online3DViewer) library is the root cause\n\n## Severity\n\n- Stored XSS: the payload persists in the repository and fires on every page view\n- Executes under the Gitea origin with the victim's session (cookies, CSRF tokens)\n- Any authenticated user viewing the file is compromised\n- Enables full account takeover (token creation, settings modification, repository manipulation)\n- No user interaction beyond viewing the file page is required\n\n## Details\n\n### Root Cause\n\nWhen Online3DViewer parses a glTF file, it checks whether all `extensionsRequired` entries are supported. For unsupported extensions, it calls:\n\n```javascript\n// In the Online3DViewer bundle (online-3d-viewer.js)\n// Approximate offset 1142618 in the bundled chunk\nthis.SetError(yp(\"Unsupported extension: {0}.\", unsupportedExtensions.join(\", \")));\n```\n\nThe `SetError` method stores this message, and Gitea's rendering code inserts it into the page using `innerHTML`:\n\n```javascript\n// Gitea's error display handler\nelement.innerHTML = errorMessage; // unsanitized\n```\n\nThe extension names from `extensionsRequired` are taken directly from the JSON file with no escaping or sanitization, allowing HTML injection.\n\n### Attack Vector\n\n1. An attacker creates a `.gltf` file with a malicious `extensionsRequired` value:\n\n```json\n{\n \"asset\": {\"version\": \"2.0\"},\n \"buffers\": [],\n \"extensionsRequired\": [\"<img src=x onerror=\\\"alert(document.cookie)\\\">\"],\n \"scenes\": []\n}\n```\n\n2. The attacker pushes this file to any Gitea repository they have write access to (including forks of public repositories).\n\n3. 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`.\n\n4. The injected `<img onerror>` handler executes arbitrary JavaScript under the Gitea origin with the victim's authenticated session.\n\n### Impact\n\nFrom the XSS context, an attacker can:\n\n- **Create API access tokens** for the victim by POSTing to `/user/settings/applications` with the page's CSRF token\n- **Read private repositories** via same-origin API calls\n- **Modify repository contents** (supply chain attacks)\n- **Escalate to admin** if the victim is a Gitea administrator\n- **Exfiltrate data** via `fetch`, `XMLHttpRequest`, or `navigator.sendBeacon`\n\n## Proof of Concept\n\n### Minimal PoC (alert box)\n\nSave as `poc.gltf` and push to any Gitea 1.25+ repository:\n\n```json\n{\n \"asset\": {\"version\": \"2.0\"},\n \"buffers\": [],\n \"extensionsRequired\": [\"<img src=x onerror=\\\"alert('XSS: '+document.domain)\\\">\"],\n \"scenes\": []\n}\n```\n\nNavigate to the file in the Gitea web UI. The alert will fire.\n\n\n## Suggested Fixes\n\nSanitize or text-encode the error message before DOM insertion. Replace `innerHTML` with `textContent` for error display:\n\n```javascript\n// Instead of:\nelement.innerHTML = errorMessage;\n\n// Use:\nelement.textContent = errorMessage;\n```\n\nAlternatively, escape HTML entities in the error message before insertion.\n\n### Additional hardening\n\n- Render 3D file previews inside a sandboxed `<iframe>` with `sandbox=\"allow-scripts\"` and a restrictive CSP (`default-src 'none'`), similar to how Gitea already handles SVG attachments\n- Apply Content-Security-Policy headers to file preview pages that restrict inline script execution",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "code.gitea.io/gitea"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.25.0"
}, {
"fixed" : "1.26.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/go-gitea/gitea/security/advisories/GHSA-9cpj-qc93-vw8v"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/go-gitea/gitea"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-17T18:10:19Z",
"nvd_published_at" : null
}
}