Skip to main content

Gogs CVE-2026-52798

| EUVDEUVD-2026-39066 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
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Authenticate as low-privileged user
  2. Delivery
    Commit crafted .ipynb with javascript: link
  3. Exploit
    Lure victim to notebook preview URL
  4. Install
    Server sanitization stripped, marked() regenerates link in DOM
  5. C2
    Victim clicks rendered link
  6. Execute
    JavaScript executes in Gogs origin
  7. Impact
    Hijack session or escalate via admin actions

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Attacker must hold a low-privileged authenticated Gogs account with permission to commit a .ipynb file to a repository the victim will browse - either by creating their own public repo or by being a collaborator on an existing repo. The victim must (1) navigate to the notebook file's preview URL (e.g. /<user>/<repo>/src/<branch>/file.ipynb), which triggers the client-side marked() re-render, and (2) actively click the malicious link, since the javascript: URL only fires on click (UI:R in the CVSS vector). The Gogs instance must be running version 0.14.2 or earlier with .ipynb preview enabled and no front-end CSP override, which is the default deployment configuration.

Impact

The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L, score 8.9) reflects a network-reachable, low-complexity attack that requires authenticated push access plus a victim click but achieves scope change with high confidentiality and integrity impact - consistent with a Stored XSS in an authenticated SaaS-style web UI. EPSS and CISA KEV data were not provided, so probabilistic exploitation likelihood and active-exploitation status cannot be confirmed; absence of a KEV listing combined with the UI:R requirement suggests this is not mass-exploited but is highly attractive for targeted account takeover, especially against administrators. The PoC is fully published in the GHSA advisory, lowering the skill barrier substantially, and Gogs instances are often internet-exposed with admin accounts that, if compromised, yield instance-wide control - so real-world risk is materially higher than a generic stored-XSS rating would suggest. No conflicting signals were observed between description, CVSS vector, and patch metadata.

Exploit ScenarioDerived

An attacker with normal user privileges creates a public repository (or commits to a repo where they are a collaborator) and pushes a .ipynb file whose Markdown cell contains [poc](javascript:alert(document.domain)) - the exact PoC published in the advisory. They then send the repository link to a targeted Gogs user, ideally an administrator; when the victim opens the notebook preview and clicks the link, attacker-controlled JavaScript runs in the Gogs origin and can exfiltrate the victim's session, create personal access tokens, or pivot to instance-wide configuration changes if the victim is an admin.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 23, 2026

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.

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.

Affected VersionsENISA

gogs < 0.14.3

Affected Packages

go gogs.io/gogs fix: 0.14.3
euvd gogs fix: 0.14.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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

Primary rating from Vendor (https://github.com/gogs/gogs).

CVSS VectorVendor: https://github.com/gogs/gogs

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
Low

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.

Executive ViewAI

Why It Matters

Gogs self-hosted Git service versions through 0.14.2 contain a stored cross-site scripting vulnerability in Jupyter notebook preview functionality where publicly available exploit code exists. Low-privileged repository contributors can inject malicious JavaScript that executes in the browsers of developers viewing affected notebooks, enabling credential theft and session hijacking.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 66% exploitable
Prevalence
Medium
popular self-hosted Git service but smaller footprint than Gitea/GitLab
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

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-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

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

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

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