# GHSA-39h7-pwv7-rc3x: Excalidraw vulnerable to XSS via Mermaid sequence diagram labels (KaTeX rendering)

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-04-24T20:41:51.000Z
- Modified: 2026-05-05T16:02:23.084Z
- Weaknesses: CWE-79, CWE-1395

## Description

### Impact

`@excalidraw/excalidraw@0.18.0` depends on a Mermaid conversion package version that resolves to a Mermaid release affected by CVE-2025-54881 / GHSA-7rqq-prvp-x9jh. User-supplied Mermaid sequence diagram labels could trigger XSS through Mermaid’s KaTeX label rendering path.

This is patched in `@excalidraw/excalidraw@0.18.1` by updating `@excalidraw/mermaid-to-excalidraw` to `2.2.2`, which uses a patched Mermaid 11 release.

Moderate severity as this XSS requires manual user action - pasting unsafe Mermaid diagram into the Excalidraw editor. No semi-automated attack vector exists by default (such as accessing a link).

### Patches

- Stable `@excalidraw/excalidraw@0.18.1` is patched.
- Unstable `@excalidraw/excalidraw@next` has resolved to patched builds since `@excalidraw/excalidraw@0.18.0-f29edf` on 2025-08-21.
- Direct consumers of `@excalidraw/mermaid-to-excalidraw` should use `1.1.3` or later.

### Workarounds

None.

### Resources

- Upstream Mermaid advisory: https://github.com/mermaid-js/mermaid/security/advisories/GHSA-7rqq-prvp-x9jh
- CVE-2025-54881

(As written by GitHub Advisory Database.)

## Affected

- @excalidraw/excalidraw (npm): from 0.18.0 before 0.18.1
- @excalidraw/mermaid-to-excalidraw (npm): from 0.3.0 before 1.1.3

## References

- <https://github.com/excalidraw/excalidraw/security/advisories/GHSA-39h7-pwv7-rc3x> (web)
- <https://github.com/mermaid-js/mermaid/security/advisories/GHSA-7rqq-prvp-x9jh> (web)
- <https://github.com/excalidraw/excalidraw> (package)
- <https://github.com/excalidraw/excalidraw/releases/tag/v0.18.1> (web)

## Sources

- GitHub Advisory Database: [GHSA-39h7-pwv7-rc3x](https://github.com/advisories/GHSA-39h7-pwv7-rc3x), CC-BY-4.0, modified 2026-05-05

---

Page: https://cve.day/GHSA-39h7-pwv7-rc3x · Whole record: https://cve.day/GHSA-39h7-pwv7-rc3x.json · Rebuilt by cve.day 2026-11-25T22:56:43.780Z
