GHSA-26gq-grmh-6xm6: Gogs.io/gogs Cross-Site Scripting Vulnerability

HIGH
CVSS 7.3
CWE-1395 CWE-79
Published
Advisory Summary

GHSA-26gq-grmh-6xm6 is a HIGH (CVSS 7.3) cross-site scripting vulnerability (CWE-1395: Dependency on Vulnerable Third-Party Component) affecting Gogs.io/gogs libraries in the Go ecosystem. The issue involves gogs vulnerable to stored xss via mermaid diagrams. Remediation is available by upgrading affected packages to version 0.13.4.

GHSA-26gq-grmh-6xm6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-26gq-grmh-6xm6
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-1395: Dependency on Vulnerable Third-Party Component
Affected Product Gogs.io/gogs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-26gq-grmh-6xm6

To remediate this vulnerability, upgrade all affected Gogs.io/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.13.4
Upgrade gogs.io/gogs to 0.13.4
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-26gq-grmh-6xm6, inspect your project dependencies for Gogs.io/gogs:

inspect dependencies for gogs.io/gogs

Analyze the terminal output to locate any version of Gogs.io/gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.4), 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.io/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 Stored XSS via mermaid diagrams due to usage of vulnerable renderer library ### Details Gogs introduced support for rendering mermaid diagrams in version [0.13.0.](https://github.com/gogs/gogs/releases/tag/v0.13.0) Currently used version of the library [mermaid 11.9.0](https://github.com/gogs/gogs/tree/main/public/plugins/mermaid-11.9.0) is vulnerable to at least two XSS scenarios with publicly available payloads Resources: https://github.com/mermaid-js/mermaid/security/advisories/GHSA-7rqq-prvp-x9jh https://github.com/mermaid-js/mermaid/security/advisories/GHSA-8gwm-58g9-j8pw ### PoC 1. Create a markdown file eg. `README.md` containing following malicious mermaid diagram (payload based on [CVE-2025-54880](https://github.com/mermaid-js/mermaid/security/advisories/GHSA-8gwm-58g9-j8pw)) ``` architecture-beta group api(cloud)[API] service db "<img src=x onerror=\"alert(document.domain)\">" [Database] in api ``` 2. The XSS should pop whenever either repository or file is viewed #### Demo https://github.com/user-attachments/assets/98320f62-6c1c-4254-aa61-95598c725235 ### Impact The attacker can potentially achieve account takeover In a worst case scenario if the victim were an instance admin this could lead to a compromise of the entire deployment ### Proposed remediation steps 1. Upgrade to a patched version of the third party library https://github.com/mermaid-js/mermaid/releases/tag/v10.9.5 2. Consider running mermaid using `sandbox` level which would mitigate impact of future potential cross-site scripting issues https://mermaid.js.org/config/usage.html#securitylevel

GHSA-26gq-grmh-6xm6 Affected Gogs.io/gogs Versions

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

References

Frequently Asked Questions

What is GHSA-26gq-grmh-6xm6?
GHSA-26gq-grmh-6xm6 is a security vulnerability in Gogs.io/gogs involving Gogs vulnerable to Stored XSS via Mermaid diagrams under CWE-1395: Dependency on Vulnerable Third-Party Component.
Which Gogs.io/gogs versions are affected?
Affected versions include releases prior to 0.13.4 across affected packages: gogs.io/gogs.
What version fixes GHSA-26gq-grmh-6xm6?
Upgrading to 0.13.4 (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.13.4. Upgrade your dependency to 0.13.4 or later.
What is the CVSS score of GHSA-26gq-grmh-6xm6?
GHSA-26gq-grmh-6xm6 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with GHSA-26gq-grmh-6xm6?
GHSA-26gq-grmh-6xm6 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-26gq-grmh-6xm6?
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-26gq-grmh-6xm6",
  "modified" : "2026-02-06T19:44:14Z",
  "published" : "2026-02-06T19:44:14Z",
  "aliases" : [ ],
  "summary" : "Gogs vulnerable to Stored XSS via Mermaid diagrams",
  "details" : "### Summary\nStored XSS via mermaid diagrams due to usage of vulnerable renderer library\n\n### Details\nGogs introduced support for rendering mermaid diagrams in version [0.13.0.](https://github.com/gogs/gogs/releases/tag/v0.13.0)\n\nCurrently used version of the library [mermaid 11.9.0](https://github.com/gogs/gogs/tree/main/public/plugins/mermaid-11.9.0) is vulnerable to at least two XSS scenarios with publicly available payloads\n\nResources:\nhttps://github.com/mermaid-js/mermaid/security/advisories/GHSA-7rqq-prvp-x9jh\nhttps://github.com/mermaid-js/mermaid/security/advisories/GHSA-8gwm-58g9-j8pw\n\n### PoC\n\n1. Create a markdown file eg. `README.md` containing following malicious mermaid diagram (payload based on [CVE-2025-54880](https://github.com/mermaid-js/mermaid/security/advisories/GHSA-8gwm-58g9-j8pw))\n```\narchitecture-beta\n    group api(cloud)[API]\n    service db \"<img src=x onerror=\\\"alert(document.domain)\\\">\" [Database] in api\n```\n2. The XSS should pop whenever either repository or file is viewed\n\n#### Demo\n\nhttps://github.com/user-attachments/assets/98320f62-6c1c-4254-aa61-95598c725235\n\n### Impact\nThe attacker can potentially achieve account takeover\nIn a worst case scenario if the victim were an instance admin this could lead to a compromise of the entire deployment\n\n### Proposed remediation steps\n1. Upgrade to a patched version of the third party library\nhttps://github.com/mermaid-js/mermaid/releases/tag/v10.9.5\n2. Consider running mermaid using `sandbox` level which would mitigate impact of future potential cross-site scripting issues\nhttps://mermaid.js.org/config/usage.html#securitylevel",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.13.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-26gq-grmh-6xm6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mermaid-js/mermaid/security/advisories/GHSA-7rqq-prvp-x9jh"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mermaid-js/mermaid/security/advisories/GHSA-8gwm-58g9-j8pw"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/commit/71a72a72ad1c8cea7940c9d7e4cbdfbc0fc3d401"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1395", "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-06T19:44:14Z",
    "nvd_published_at" : null
  }
}