CVE-2026-52798 is a high-severity cross-site scripting (XSS) vulnerability in gogs.io/gogs (go), affecting versions <= 0.14.2. It is fixed in 0.14.3.
Summary Although .ipynb previews are sanitized on the server side via /-/api/sanitizeipynb, 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. Details After the rendered output of a .ipynb file is sanitized via /-/api/sanitizeipynb 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/viewfile.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 Steps to Reproduce As the attacker, add and push/commit a .ipynb file containing a javascript: link in a Markdown cell to a repository. Example (PoC): json { "nbformat": 4, "nbformatminor": 2, "metadata": {}, "cells": { "cell_type": "markdown", "metadata": {}, "source": [ "[poc)" ] } ] } The victim opens the file on Gogs (e.g., /<user>/<repo>/src/<branch>/poc.ipynb). <img width="2386" height="1218" alt="image" src="https://github.com/user-attachments/assets/b0d93fd8-c5ca-4058-8af0-98dee590d3ad" /> When the victim clicks the poc link displayed in the preview, alert(document.domain) is executed in the same Gogs origin. <img width="2390" height="1388" alt="image" src="https://github.com/user-attachments/assets/0eb6ebe8-632c-4a41-8a11-46471514b4c4" /> Minimum Required Privileges Attacker: Ability to place a .ipynb file as a regular (non-admin) user For example: a general user who can create a public repository and add files. Or: write access (collaborator, etc.) to an existing repository that the victim will view. Victim: Permission to view the repository (a click is required). Impact Unauthorized actions performed with the victim’s account privileges (e.g., repository settings changes, Issue operations,誘導 to token creation). Theft of information accessible to the victim (repository/Issue/Wiki contents, tokens exposed in page context). If the victim is an administrator, the impact may escalate to instance-wide configuration changes and user management.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
CVE-2026-52798 has a CVSS score of 8.9 (High). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.
A fixed version is available (0.14.3). Upgrading removes the vulnerable code path.
go
gogs.io/gogs (<= 0.14.2)gogs.io/gogs → 0.14.3 (go)Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.
Kodem's runtime-powered SCA identifies whether CVE-2026-52798 is reachable in your applications. Explore open-source security for your team.
See if CVE-2026-52798 is reachable in your applications. Get a demo
Already deployed Kodem? See CVE-2026-52798 in your environment →Upgrade gogs.io/gogs to 0.14.3 or later to resolve this vulnerability.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
CVE-2026-52798 is a high-severity cross-site scripting (XSS) vulnerability in gogs.io/gogs (go), affecting versions <= 0.14.2. It is fixed in 0.14.3. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
CVE-2026-52798 has a CVSS score of 8.9 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
gogs.io/gogs (go) versions <= 0.14.2 is affected.
Yes. CVE-2026-52798 is fixed in 0.14.3. Upgrade to this version or later.
Whether CVE-2026-52798 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
Upgrade gogs.io/gogs to 0.14.3 or later.