Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-26gq-grmh-6xm6
No affected components available
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: 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
- Create a markdown file eg.
README.mdcontaining following malicious mermaid diagram (payload based on CVE-2025-54880)
architecture-beta
group api(cloud)[API]
service db "<img src=x onerror=\"alert(document.domain)\">" [Database] in api
- 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
- Upgrade to a patched version of the third party library https://github.com/mermaid-js/mermaid/releases/tag/v10.9.5
- Consider running mermaid using
sandboxlevel which would mitigate impact of future potential cross-site scripting issues https://mermaid.js.org/config/usage.html#securitylevel
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs basic access or low-level privileges. The attacker needs the user to perform some action, like clicking a link. The impact is confined to the system where the vulnerability exists. There is a high impact on the confidentiality of the information. There is a high impact on the integrity of the data.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard