# CVE-2026-52816: Gogs stored XSS in Jupyter Notebook sanitizer endpoint

Source: https://junglewise.ai/threats/cve-2026-52816-gogs-stored-xss-in-jupyter-notebook-sanitizer-endpoint  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-24. Updated: 2026-06-24  
License: CC BY 4.0 with a link back

CVE-2026-52816 · Severity: medium · CVSS 4 · Published 2026-06-24

Gogs is an open-source self-hosted Git service used by developers to manage source code. A security flaw in how the platform handles Jupyter Notebook files allows attackers to bypass security filters and inject malicious scripts. If a user is tricked into interacting with a specially crafted notebook preview, an attacker could execute unauthorized actions or steal sensitive information from the user's session.

Technologies: [gogs.io/gogs (Go)](https://junglewise.ai/threats/technologies/gogs-io-gogs), [Gogs](https://junglewise.ai/threats/technologies/gogs). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Gogs](https://junglewise.ai/threats/vendors/gogs).

## Quick answers

**Is CVE-2026-52816 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-52816 being exploited in the wild.

**How severe is CVE-2026-52816?** Medium severity, with a CVSS score of 4, published 24 June 2026.

**Which products and versions are affected?** gogs.io/gogs (Go) < 0.14.3, SEMVER:introduced=0, SEMVER:introduced=0,fixed=0.14.3; Gogs < 0.14.3.

**Is there a fix for CVE-2026-52816?** Yes. gogs.io/gogs (Go): upgrade to 0.14.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-52816 attacked?** It is attacked over the network, in a network appliance.

**Am I affected by CVE-2026-52816?** Check whether you run gogs.io/gogs (Go) or Gogs at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- gogs.io/gogs (Go): upgrade to 0.14.3 or later

  ```sh
  go get gogs.io/gogs@v0.14.3
  ```


## Technical details

A Cross-Site Scripting (XSS) vulnerability exists in Gogs' Jupyter Notebook (.ipynb) sanitization endpoint. The 'POST /-/api/sanitize_ipynb' endpoint utilizes the bluemonday library with a policy that explicitly allows all 'data:' URI schemes via 'p.AllowURLSchemes("data")'. This configuration fails to restrict the MIME types allowed within the data URI, permitting 'data:text/html' payloads containing malicious JavaScript. Furthermore, the endpoint lacks authentication middleware, making it accessible to any registered user. An attacker can submit crafted HTML to the endpoint and receive a response where the malicious script is preserved, which executes when rendered in a victim's browser context. This was resolved in version 0.14.3 by implementing a restricted allowlist for safe image MIME types.

## Affected products

- Gogs Gogs < 0.14.3

## Identifiers

- CVE-2026-52816
- GHSA-3w28-36p9-w929
- GO-2026-5103

## Timeline

- 2026-06-06: patched: Fix merged into main branch
- 2026-06-07: advisory: Version 0.14.3 released
- 2026-06-24: disclosed: CVE-2026-52816 published

## References

- [https://github.com/gogs/gogs/commit/dd1bd9837aa196b3ed3a8ee21e5727b5d7a986a3](https://github.com/gogs/gogs/commit/dd1bd9837aa196b3ed3a8ee21e5727b5d7a986a3)
- [https://github.com/gogs/gogs/pull/8326](https://github.com/gogs/gogs/pull/8326)
- [https://github.com/gogs/gogs/releases/tag/v0.14.3](https://github.com/gogs/gogs/releases/tag/v0.14.3)
- [https://github.com/gogs/gogs/security/advisories/GHSA-3w28-36p9-w929](https://github.com/gogs/gogs/security/advisories/GHSA-3w28-36p9-w929)

## Related threats

- [Gogs Git Smart HTTP authorization bypass](https://junglewise.ai/threats/cve-2026-123012-in-gogs-0-14-3-the-git-smart-http-authorization-layer-in)
- [Gogs open redirect via backslash normalization mismatch](https://junglewise.ai/threats/cve-2026-82402-gogs-is-an-open-source-self-hosted-git-service-prior-to-0-15-0)
- [GO-2026-5193 - Gogs: XSS in .ipynb files renderer due to outdated notebookjs in gogs.io/gogs](https://junglewise.ai/threats/go-2026-5193-gogs-xss-in-ipynb-files-renderer-due-to-outdated-d1e8727f)
- [Gogs unauthenticated information disclosure in organization teams API](https://junglewise.ai/threats/cve-2026-52815-gogs-unauthenticated-information-disclosure-in-organization-teams)
- [Gogs Denial of Service via SSH handshake stall in built-in SSH server](https://junglewise.ai/threats/cve-2026-52814-gogs-denial-of-service-via-ssh-handshake-stall-in-built-in-ssh)
