/

CVE-2026-32308

Severity:

HIGH RISK

(7.6)

Cross-Site Scripting (XSS) in OneUptime

CVE-2026-32308

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Arbitrary JavaScript Execution in User Browsers

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OneUptime's Markdown viewer rendered Mermaid diagrams with a permissive securityLevel: "loose" setting and injected the generated SVG via innerHTML, allowing interactive event bindings.

When an attacker controls markdown content (for example in incident descriptions, status page announcements, or monitor notes), they can abuse Mermaid's click directive to execute arbitrary JavaScript in the victim's browser.

Affected context

The vulnerability affects any OneUptime deployment where:

  • Markdown rendering is enabled in user-visible fields, and
  • Mermaid diagrams are supported in the Markdown viewer, and
  • The Mermaid renderer uses securityLevel: "loose" and injects SVG output with innerHTML.

Typical contexts include incident descriptions, status page announcements, monitor notes, and any other fields that accept markdown content and are displayed in a browser without sufficient script interaction restrictions.

Exploit preconditions

  • Attack surface: Web UI where markdown with Mermaid diagrams is rendered.
  • Required access: Ability to create or modify markdown content that will be rendered for other users (e.g., incident editors, status page maintainers, or any account with markdown input privileges).
  • Trigger point: A victim user views a page where the crafted Mermaid diagram is rendered by the Markdown viewer.
  • Why exploitation is possible: The Mermaid renderer is configured with securityLevel: "loose" and its SVG output is inserted via innerHTML, which allows event handlers and interactive directives (such as Mermaid's click directive) to bind JavaScript execution in the rendered page context.

Why this happens

This issue stems from a combination of permissive client-side rendering configuration and unsafe DOM injection practices.

Mermaid's securityLevel: "loose" explicitly allows interactive event bindings, including the click directive that can trigger JavaScript actions.

The Markdown viewer then injects the generated Mermaid SVG into the DOM using innerHTML, a sink that can introduce script-capable markup when not carefully constrained.

Together, these behaviors map to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where untrusted content is allowed to influence active browser-side behavior without robust sanitization or isolation.

Potential impact

  • Execution of arbitrary JavaScript in the context of the affected OneUptime domain
  • Theft of session tokens or other sensitive data accessible via the browser (subject to cookie and CSP configuration)
  • Unauthorized actions performed on behalf of the victim user (e.g., account changes, configuration updates)
  • Manipulation or falsification of monitoring data, incident descriptions, or status announcements
  • Use of the application as a pivot to deliver further phishing or social engineering attacks

General mitigation guidance

Effective mitigation focuses on treating all user-controlled markdown and diagram content as untrusted and minimizing its ability to create active behaviors in the browser:

  • Prefer Mermaid's restricted security modes (e.g., securityLevel: "strict" or an equivalent) that disable interactive directives and event handlers.
  • Avoid injecting diagram output with innerHTML; instead, use safer DOM APIs that do not interpret markup as executable behavior, or apply robust, allowlist-based SVG sanitization before insertion.
  • Restrict or fully disable high-risk features in diagram syntax (like click handlers or other scripting hooks) when content originates from users.
  • Apply Content Security Policy (CSP) rules that reduce the impact of any residual XSS (e.g., disallow inline scripts and restrict script sources).
  • Separate trusted and untrusted content paths: administrative or system-generated diagrams can be rendered with more capabilities, while user-generated content uses hardened rendering paths.

How teams detect issues like this

Detection should focus on identifying unsafe rendering patterns and interactive diagram usage:

  • Static analysis / code scanning:
  • Flag client-side code that sets Mermaid securityLevel to "loose" or other permissive modes for untrusted content.
  • Detect uses of innerHTML, outerHTML, or similar APIs where the source data originates from markdown or other user-controlled content.
  • Code review signals:
  • Pay special attention to UI components that render markdown, diagrams, or rich text, verifying that they apply strict configuration and sanitization.
  • Review any integrations with diagramming libraries (like Mermaid) to ensure interactive features are disabled for user input.
  • Runtime / policy enforcement:
  • Deploy CSP with reporting enabled to capture and investigate script execution attempts that originate from rendered diagrams.
  • Use security testing tools or browser-based scanners to exercise markdown fields with synthetic Mermaid payloads and observe for active script behavior.
  • Automated tooling:
  • Integrate SAST/DAST tools into CI/CD pipelines to flag unsafe DOM sinks and permissive client configuration patterns before deployment.

Sources

SourceLink
github.comgithub.com/OneUptime/oneuptime/security/advisories/GHSA-wvh5-6vjm-23qh

Frequently asked

questions

Yes. If an attacker can create or modify markdown content that is later viewed by other users in a browser, they can remotely deliver a stored XSS payload through Mermaid diagrams.

The attacker needs the ability to submit or edit markdown content in a context where Mermaid diagrams are rendered. This might be an authenticated role (e.g., a user who can create incidents or announcements) or any other channel that feeds into markdown-rendered fields.

The safest approach is to configure diagram rendering for untrusted content in a locked-down mode (e.g., Mermaid securityLevel that disables scripting and interactivity), avoid innerHTML for injecting rendered diagrams, and ensure that any SVG or HTML output is sanitized with a strict allowlist-based sanitizer.

Treat all markdown and diagram content as untrusted, use libraries in their hardened or sandboxed modes by default, avoid generic HTML injection APIs, enforce strong CSP, and incorporate security reviews for any new rich-content rendering features, especially those involving diagrams or embedded interactive elements.

Find out what's already
exploitable in your codebase.