You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Gogs vulnerable to Stored XSS via Mermaid diagrams
High severity
GitHub Reviewed
Published
Feb 6, 2026
in
gogs/gogs
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
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Learn more on MITRE.
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.
Currently used version of the library mermaid 11.9.0 is vulnerable to at least two XSS scenarios with publicly available payloads
Resources:
GHSA-7rqq-prvp-x9jh
GHSA-8gwm-58g9-j8pw
PoC
README.mdcontaining following malicious mermaid diagram (payload based on CVE-2025-54880)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
https://github.com/mermaid-js/mermaid/releases/tag/v10.9.5
sandboxlevel which would mitigate impact of future potential cross-site scripting issueshttps://mermaid.js.org/config/usage.html#securitylevel
References