Skip to main content

Gogs EUVDEUVD-2026-39076

| CVE-2026-52816 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-06-23 https://github.com/gogs/gogs GHSA-3w28-36p9-w929
5.4
CVSS 4.0 · Vendor: https://github.com/gogs/gogs
View

Attack ChainAIDerived

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

  1. Access
    Obtain registered Gogs account
  2. Delivery
    POST data:text/html payload to /-/api/sanitize_ipynb
  3. Exploit
    Receive XSS payload intact in sanitized response
  4. Execution
    Commit malicious notebook to shared repository
  5. Persist
    Victim views notebook preview in browser
  6. Impact
    Embedded JavaScript executes in victim's session context

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

The attacker must possess a registered Gogs user account - anonymous access is not sufficient, though the /-/api/sanitize_ipynb endpoint itself applies no explicit authentication middleware at the routing layer. The target Gogs deployment must support Jupyter notebook (.ipynb) file rendering (i.e., the endpoint must exist and be reachable). For cross-user impact (stored XSS), the attacker must additionally be able to cause a victim to view the rendered notebook preview in their browser, typically by committing a malicious notebook to a shared repository. Limiting factors: (1) open registration or a compromised/malicious insider account is required; (2) victim must navigate to and render the notebook; (3) Gogs instances with registration disabled and only fully trusted users face substantially reduced exposure; (4) instances behind network controls that block unauthenticated external HTTP access reduce the attack surface.

Impact

No vendor-supplied CVSS vector or EPSS score is available for CVE-2026-52816, so quantitative risk signals are absent. From first principles: the attack vector is network, complexity is low, privileges required are low (registered account only), and user interaction is required for cross-user impact (stored XSS variant requires a victim to view the notebook). The scope changes because exploitation fires JavaScript in a victim's browser session rather than the server. A proof-of-concept is publicly available via the GHSA advisory, which substantially lowers the exploitation bar. No CISA KEV listing exists, indicating no confirmed widespread active exploitation at time of analysis. Real-world risk is meaningfully elevated for Gogs instances with open registration or with untrusted internal users, particularly where notebook viewing is common; risk is substantially lower for private instances with only fully trusted operators. The absence of CVSS and EPSS data means priority should be driven by the presence of a public POC, the low privilege bar (registered account), and the confirmed patch in v0.14.3.

Exploit ScenarioDerived

A registered user on a public Gogs instance sends a POST request to /-/api/sanitize_ipynb containing <a href="data:text/html,<script>alert(document.cookie)</script>">click</a>; the server returns the payload intact because bluemonday's policy allows all data URI schemes. The attacker embeds this sanitized output into a shared Jupyter notebook in a repository, and when another authenticated user opens the notebook preview, the data:text/html URI resolves in their browser and the embedded script executes, exposing their session cookie. A POC demonstrating this exact HTTP exchange is publicly documented in GHSA-3w28-36p9-w929.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.7% 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 XSS in Gogs's Jupyter notebook (.ipynb) preview allows any registered user to inject arbitrary JavaScript via data:text/html URIs that survive the bluemonday sanitization pipeline, affecting all versions prior to 0.14.3. The POST /-/api/sanitize_ipynb endpoint uses p.AllowURLSchemes("data") without MIME-type gating, unlike the safer IsSafeDataURI validator used elsewhere in the codebase, and carries no authentication middleware - making it reachable by any account holder. A proof-of-concept is publicly documented in GHSA-3w28-36p9-w929; no CISA KEV listing or EPSS data is available at time of analysis.

RemediationAI

Upgrade Gogs to version 0.14.3 or later; this release replaces the unsafe p.AllowURLSchemes("data") call in internal/app/api.go with p.AllowURLSchemeWithCustomPolicy("data", markup.IsSafeDataURI), restricting data URIs to safe image MIME types. The patch is available at https://github.com/gogs/gogs/pull/8326 (commit dd1bd9837aa196b3ed3a8ee21e5727b5d7a986a3). If immediate upgrade is not feasible, apply a reverse proxy or WAF rule to block all POST requests to the path /-/api/sanitize_ipynb - this disables Jupyter notebook rendering as a side effect. A second compensating control is to add authentication middleware to the endpoint route in cmd/gogs/web.go, which limits exploitation to authenticated users but does not fix the underlying MIME-type bypass and requires a code change. Disabling data: URI support entirely by removing the AllowURLSchemes("data") call is viable if inline images in notebooks are not required by the deployment.

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 (gogs.io/gogs, pkg:go/gogs.io_gogs) is a self-hosted Git service written in Go. The vulnerability (CWE-79, Improper Neutralization of Input During Web Page Generation) lives in internal/app/api.go, where ipynbSanitizer() constructs a bluemonday HTML policy via UGCPolicy() and then calls p.AllowURLSchemes("data"), whitelisting the entire data: URI scheme with no MIME-type restriction. Browsers treat data:text/html URIs as fully functional HTML documents and will execute embedded <script> tags or event handlers within them. The codebase already contained a correct pattern - AllowURLSchemeWithCustomPolicy("data", IsSafeDataURI) in internal/markup/sanitizer.go:39 - that restricts data URIs to safe image MIME types, but this was not applied to the ipynb sanitizer. The endpoint route at cmd/gogs/web.go:682 is also grouped outside any authentication middleware, so the HTTP session check is entirely absent at the framework routing layer.

Know when the next one hits your stack

  • 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 5.4 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N/E:P
vuln.today AI 5.4 MEDIUM

Network endpoint requiring a registered account (PR:L) and victim browser interaction (UI:R) for stored XSS; scope changes as JavaScript executes in victim's browser session (S:C), with low confidentiality and integrity impact.

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

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

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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jun 24, 2026 - 21:22 NVD
5.4 (MEDIUM)

DescriptionCVE.org

Summary

The Jupyter Notebook (ipynb) sanitizer endpoint at POST /-/api/sanitize_ipynb allows arbitrary data: URIs without proper restrictions, potentially leading to Cross-Site Scripting (XSS). The endpoint uses bluemonday.UGCPolicy() with p.AllowURLSchemes("data") which permits all data URI schemes including data:text/html, enabling attackers to inject malicious HTML/JavaScript. Additionally, the endpoint has no authentication middleware, allowing any registered user to exploit this vulnerability.

Severity

High

Affected Versions

All versions using the vulnerable endpoint

Vulnerability Details

  • CVE ID: (To be assigned)
  • Entry Point: POST /-/api/sanitize_ipynb
  • Attack Vector: Network
  • Authentication Required: No (only needs a registered user account)

Impact

An attacker with a registered user account can:

  • Send malicious HTML containing data:text/html URIs to the sanitization endpoint
  • Receive sanitized but attacker-controlled HTML in the response
  • Execute arbitrary JavaScript in the attacker's browser context through XSS
  • Potentially exploit other users if the sanitized output is rendered in their context

The vulnerability has higher severity because:

  1. No authentication required (only needs a registered user account)
  2. Unlike the safer pattern in internal/markup/sanitizer.go:39 which uses isSafeDataURI to only allow safe image MIME types, this endpoint allows ALL data URIs including HTML
  3. The returned HTML can be used to craft XSS attacks

Proof of Concept

Attacker sends a POST request to the sanitization endpoint:

http
POST /-/api/sanitize_ipynb HTTP/1.1
Host: target.gogs.instance
Content-Type: text/plain

<a href="data:text/html,<script>alert(document.cookie)</script>">click</a>

The server returns the sanitized HTML with the data URI preserved:

html
<a href="data:text/html,<script>alert(document.cookie)</script>">click</a>

When this HTML is rendered in a browser, the JavaScript within the data URI will execute, leading to XSS.

Affected Component

File: internal/app/api.go:10-16

go
func ipynbSanitizer() *bluemonday.Policy {
	p := bluemonday.UGCPolicy()
	p.AllowAttrs("class", "data-prompt-number").OnElements("div")
	p.AllowAttrs("class").OnElements("img")
	p.AllowURLSchemes("data")  // <-- VULNERABLE: allows all data URIs
	return p
}

File: cmd/gogs/web.go:681-683 - No authentication middleware

go
m.Group("/-", func() {
	m.Get("/metrics", app.MetricsFilter(), promhttp.Handler())
	m.Group("/api", func() {
		m.Post("/sanitize_ipynb", app.SanitizeIpynb())  // <-- No auth middleware
	})
})

Root Cause

  1. Unrestricted data URI scheme: The code at internal/app/api.go:14 uses p.AllowURLSchemes("data") without any restriction, unlike the safer implementation in internal/markup/sanitizer.go:39 which uses AllowURLSchemeWithCustomPolicy("data", isSafeDataURI) to only allow safe image MIME types.
  2. No authentication: The endpoint at cmd/gogs/web.go:682 does not have any authentication middleware applied, making it accessible to any registered user.
  3. Insufficient validation: The sanitization only removes dangerous tags/attributes but preserves data URIs, allowing data:text/html payloads to pass through.

Suggested Fix

Option 1: Use the same safe pattern as internal/markup/sanitizer.go

Replace p.AllowURLSchemes("data") with:

go
p.AllowURLSchemeWithCustomPolicy("data", isSafeDataURI)

Where isSafeDataURI is a function that only allows safe image MIME types (image/png, image/jpeg, image/gif, etc.).

Option 2: Add authentication middleware

Apply appropriate authentication to the endpoint:

go
m.Post("/sanitize_ipynb", middleware.signIn, app.SanitizeIpynb())

Option 3: Disable data URI scheme entirely

If data URIs are not required for ipynb sanitization:

go
// Remove this line entirely:
// p.AllowURLSchemes("data")

Threat Intelligence Overview

EPSS Score
0.7%
Top 52% exploitable
Prevalence
Low
niche self-hosted Git platform, well behind GitHub/GitLab/Gitea in deployment share
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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.7%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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· derived
Medium

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +27
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.

Vendor StatusVendor

SUSE

Severity: Moderate
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