GHSA-6vxv-wg6j-5qwp: Gogs Cross-Site Scripting Vulnerability

HIGH
CWE-1395 CWE-80
Published
Advisory Summary

GHSA-6vxv-wg6j-5qwp is a HIGH cross-site scripting vulnerability (CWE-1395: Dependency on Vulnerable Third-Party Component) affecting Gogs libraries in the Go ecosystem. The issue involves xss in .ipynb files renderer due to outdated notebookjs. Remediation is available by upgrading affected packages to version 0.14.3.

GHSA-6vxv-wg6j-5qwp at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6vxv-wg6j-5qwp
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1395: Dependency on Vulnerable Third-Party Component
Affected Product Gogs
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-6vxv-wg6j-5qwp

To remediate this vulnerability, upgrade all affected Gogs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gogs.io/gogs fixed: 0.14.3
Upgrade gogs.io/gogs to 0.14.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gogs.io/gogs

How to Check if You Are Affected

To determine whether your application is affected by GHSA-6vxv-wg6j-5qwp, inspect your project dependencies for Gogs:

inspect dependencies for gogs.io/gogs

Analyze the terminal output to locate any version of Gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1395: Dependency on Vulnerable Third-Party Component, where the product has a dependency on a third-party component that contains one or more known vulnerabilities. In Gogs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Gogs renders Jupyter notebook files (`.ipynb`) using [jsvine/notebookjs](https://github.com/jsvine/notebookjs), but the version is outdated, missing patches for known XSS vulnerabilities. ### Details Gogs uses version 0.4.2 of notebookjs to render Jupyter notebook files: https://github.com/gogs/gogs/blob/7297aee50d4c115836c7de8a3a233daaef87b911/templates/base/head.tmpl#L47 The latest version of [jsvine/notebookjs](https://github.com/jsvine/notebookjs) is 0.8.3, patching many XSS vulnerabilities in its releases. The proof of concept below shows an example working payload that renders HTML through Markdown. ### PoC 1. Create a new repository 2. Create a file inside the repository named `xss.ipynb` and give it the following content: ```json {"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<img src=x onerror=\"alert(origin)\">"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 2} ``` <img width="1054" height="208" alt="image" src="https://github.com/user-attachments/assets/49b7f33c-c4df-4537-99e9-b1ea74f2c6de" /> 3. Save the file and view the file in Gogs. Notice that the XSS popup triggers: <img width="1317" height="407" alt="image" src="https://github.com/user-attachments/assets/3b18d870-7194-41b0-92db-687e952abc07" /> ### Impact Any user with rights to create repositories can create XSS payloads that take over the victim's account when visited. Either through their own exploration of the files or by directly linking them the vulnerable URL.

GHSA-6vxv-wg6j-5qwp Affected Gogs Versions

1 component(s)
Fixed Versions:
0.14.3
Product / Package Ecosystem Affected Versions Fixed Version
gogs.io/gogs
Go
< 0.14.3
0.14.3

References

Frequently Asked Questions

What is GHSA-6vxv-wg6j-5qwp?
GHSA-6vxv-wg6j-5qwp is a security vulnerability in Gogs involving XSS in .ipynb files renderer due to outdated notebookjs under CWE-1395: Dependency on Vulnerable Third-Party Component.
Which Gogs versions are affected?
Affected versions include releases prior to 0.14.3 across affected packages: gogs.io/gogs.
What version fixes GHSA-6vxv-wg6j-5qwp?
Upgrading to 0.14.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to 0.14.3. Upgrade your dependency to 0.14.3 or later.
What CWE is associated with GHSA-6vxv-wg6j-5qwp?
GHSA-6vxv-wg6j-5qwp is classified under CWE-1395: Dependency on Vulnerable Third-Party Component (The product has a dependency on a third-party component that contains one or more known vulnerabilities.).
How can I check Go dependencies for GHSA-6vxv-wg6j-5qwp?
Run the dependency tree command: 'inspect dependencies for gogs.io/gogs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6vxv-wg6j-5qwp",
  "modified" : "2026-06-19T21:42:52Z",
  "published" : "2026-06-19T21:42:52Z",
  "aliases" : [ ],
  "summary" : "Gogs: XSS in .ipynb files renderer due to outdated notebookjs",
  "details" : "### Summary\n\nGogs renders Jupyter notebook files (`.ipynb`) using [jsvine/notebookjs](https://github.com/jsvine/notebookjs), but the version is outdated, missing patches for known XSS vulnerabilities.\n\n### Details\n\nGogs uses version 0.4.2 of notebookjs to render Jupyter notebook files:\n\nhttps://github.com/gogs/gogs/blob/7297aee50d4c115836c7de8a3a233daaef87b911/templates/base/head.tmpl#L47\n\nThe latest version of [jsvine/notebookjs](https://github.com/jsvine/notebookjs) is 0.8.3, patching many XSS vulnerabilities in its releases. The proof of concept below shows an example working payload that renders HTML through Markdown.\n\n### PoC\n\n1. Create a new repository\n2. Create a file inside the repository named `xss.ipynb` and give it the following content:\n\n```json\n{\"cells\": [{\"cell_type\": \"markdown\", \"metadata\": {}, \"source\": [\"<img src=x onerror=\\\"alert(origin)\\\">\"]}], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}\n```\n\n<img width=\"1054\" height=\"208\" alt=\"image\" src=\"https://github.com/user-attachments/assets/49b7f33c-c4df-4537-99e9-b1ea74f2c6de\" />\n\n3. Save the file and view the file in Gogs. Notice that the XSS popup triggers:\n\n<img width=\"1317\" height=\"407\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3b18d870-7194-41b0-92db-687e952abc07\" />\n\n### Impact\n\nAny user with rights to create repositories can create XSS payloads that take over the victim's account when visited. Either through their own exploration of the files or by directly linking them the vulnerable URL.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.14.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-6vxv-wg6j-5qwp"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1395", "CWE-80" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T21:42:52Z",
    "nvd_published_at" : null
  }
}