All vulnerabilities

Servers and applications

CVE-2026-52798

Stored XSS in `.ipynb` Preview

Severity
High 8.9
Published
19 Jun 2026
Last changed
19 Jun 2026
Added to UpHeron
3 Nov 2026
Fixed in
0.14.3
Exploit chance
0.4% in the next 30 daysHigher than 37% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Cross-site scripting (CWE-79)
Attack
Over the network · Needs a user account · Needs someone to click or open something
Attacker can
Read data · Change data · Slow it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L
Also known as
GHSA-jq8v-rmf6-65jw
Sources
Project advisories (GitHub)

Description

Although .ipynb previews are sanitized on the server side via /-/api/sanitize_ipynb, the inserted content is re-rendered on the client side without sanitization using marked() on elements with the .nb-markdown-cell class. During this process, links containing schemes such as javascript: can be regenerated.

As a result, when a victim views an attacker-crafted .ipynb file and clicks the link, arbitrary JavaScript is executed in the Gogs origin, leading to a click-based Stored XSS.

After the rendered output of a .ipynb file is sanitized via /-/api/sanitize_ipynb and inserted into the DOM, only the Markdown cell portions are re-rendered using marked() and overwritten in the DOM. During this process, links with the javascript: scheme can be regenerated.

templates/repo/view_file.tmpl:42–71

While regular HTML pages (including .ipynb preview pages) are served without a Content Security Policy (CSP), CSP headers are applied only to attachment delivery routes.

internal/cmd/web.go:323

From gogs/gogs's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
GogsServers and applications · github:gogs/gogs
  • Every version before 0.14.3

About Gogs

free forge based on Git written in Go

From Wikidata, CC0 1.0.
Docker Hub pulls
94,040,857Docker Hub, 15 Nov 2026
GitHub stars
47,939GitHub, 15 Nov 2026
Forks
5,082GitHub, 15 Nov 2026
Latest release
v0.14.4GitHub, 15 Nov 2026
Released
12 Nov 2026GitHub
Developer
FLOSS contributorWikidata
License
Expat licenseWikidata
Written in
Go, Cascading Style Sheets, JavaScriptWikidata
First released
11 Feb 2014Wikidata
First published on GitHub
12 Feb 2014GitHub

References