Severity by source
AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L
Network-reachable web UI (AV:N), trivial crafted file (AC:L), attacker needs a normal account to push (PR:L), victim must click the link (UI:R), XSS escapes notebook context to whole Gogs origin (S:C) with high C/I and some availability impact via admin actions.
Primary rating from Vendor (https://github.com/gogs/gogs).
CVSS VectorVendor: https://github.com/gogs/gogs
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L
Lifecycle Timeline
3DescriptionCVE.org
Summary
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.
Details
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
{{else if .IsIPythonNotebook}}
<script>
$.getJSON("{{.RawFileLink}}", null, function(notebook_json) {
var notebook = nb.parse(notebook_json);
var rendered = notebook.render();
$.ajax({
type: "POST",
url: '{{AppSubURL}}/-/api/sanitize_ipynb',
data: rendered.outerHTML,
processData: false,
contentType: false,
}).done(function(data) {
$("#ipython-notebook").append(data);
$("#ipython-notebook code").each(function(i, block) {
$(block).addClass("py").addClass("python");
hljs.highlightBlock(block);
});
// Overwrite image method to append proper prefix to the source URL
var renderer = new marked.Renderer();
var context = '{{.RawFileLink}}';
context = context.substring(0, context.lastIndexOf("/"));
renderer.image = function (href, title, text) {
return `<img src="${context}/${href}"`
};
$("#ipython-notebook .nb-markdown-cell").each(function(i, markdown) {
$(markdown).html(marked($(markdown).html(), {renderer: renderer}));
});
});
});
</script>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
c.Header().Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; sandbox")Steps to Reproduce
- As the attacker, add and push/commit a
.ipynbfile containing ajavascript:link in a Markdown cell to a repository.
- Example (PoC):
{
"nbformat": 4,
"nbformat_minor": 2,
"metadata": {},
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[poc](javascript:alert(document.domain))"
]
}
]
}- 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
poclink 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
.ipynbfile 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.
Articles & Coverage 1
AnalysisAI
Stored cross-site scripting in Gogs (self-hosted Git service) versions through 0.14.2 allows a low-privileged repository user to inject JavaScript via a crafted Jupyter notebook (.ipynb) Markdown cell containing a javascript: scheme link, which executes in the Gogs origin when a victim clicks the rendered link. Although server-side sanitization is performed via /-/api/sanitize_ipynb, the client subsequently re-renders Markdown cells with marked() and regenerates the dangerous links, and the file preview page is served without a Content Security Policy. Publicly available exploit code exists (full PoC published in the GHSA advisory) but there is no public exploit identified at time of analysis as actively exploited in the wild.
Technical ContextAI
Gogs is a Go-based self-hosted Git hosting service (pkg:go/gogs.io_gogs) that renders Jupyter notebook files inline. The vulnerability is a classic CWE-79 (Improper Neutralization of Input During Web Page Generation) caused by a double-rendering pipeline: templates/repo/view_file.tmpl first POSTs the rendered notebook HTML to /-/api/sanitize_ipynb for server-side sanitization, then on success runs marked() (Marked v0.8.1) over every element with class .nb-markdown-cell, replacing the sanitized DOM with newly parsed Markdown. Because the second pass reintroduces link tokens parsed from the cell's source, javascript: hrefs that were stripped server-side are recreated client-side. The issue is compounded by internal/cmd/web.go applying a restrictive CSP (default-src 'none'; sandbox) only to attachment delivery routes, leaving the notebook preview page with no CSP fallback to block inline JavaScript execution.
RemediationAI
Vendor-released patch: upgrade Gogs to version 0.14.3 or later as published at https://github.com/gogs/gogs/releases/tag/v0.14.3, which applies the fix from PR #8319 (commit 17b168b11ca759a7550e1f4bbd68bbde14db7785) and removes the bundled marked-0.8.1 client renderer that regenerated javascript: links. If immediate upgrade is not possible, administratively disable .ipynb file preview rendering (forcing notebooks to download as raw rather than render inline), which fully neutralizes this code path at the cost of usability for data-science workflows. As an additional compensating control, deploy a strict Content Security Policy at the reverse proxy in front of Gogs (for example default-src 'self'; script-src 'self'; object-src 'none') to block inline script execution on the notebook preview route; note this may break legitimate inline scripts in other Gogs pages and should be tested before rollout. Refer to the vendor advisory at https://github.com/gogs/gogs/security/advisories/GHSA-jq8v-rmf6-65jw for authoritative guidance.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
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
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing
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-39066
GHSA-jq8v-rmf6-65jw