Skip to main content

Gogs EUVDEUVD-2026-39066

| CVE-2026-52798 HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-06-22 https://github.com/gogs/gogs GHSA-jq8v-rmf6-65jw
8.9
CVSS 3.1 · Vendor: https://github.com/gogs/gogs
Share

Severity by source

Vendor (https://github.com/gogs/gogs) PRIMARY
8.9 HIGH
AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L
vuln.today AI
8.9 HIGH

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.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L
4.0 AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:L/SC:H/SI:H/SA:N
SUSE
HIGH
qualitative

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
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
Low

Lifecycle Timeline

3
Source Code Evidence Fetched
Jun 23, 2026 - 00:13 vuln.today
Analysis Generated
Jun 23, 2026 - 00:13 vuln.today
CVE Published
Jun 22, 2026 - 23:58 github-advisory
HIGH 8.9

DescriptionCVE.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

html
{{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

go
c.Header().Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; sandbox")

Steps to Reproduce

  1. 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,
       "nbformat_minor": 2,
       "metadata": {},
       "cells": [
         {
           "cell_type": "markdown",
           "metadata": {},
           "source": [
             "[poc](javascript:alert(document.domain))"
           ]
         }
       ]
     }
  1. 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" />

  1. 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.

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.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

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

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

CVE-2026-55255 HIGH POC
8.4 Jun 19

Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing

Vendor 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

Share

EUVD-2026-39066 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy