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

- Severity: High 8.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.46%, higher than 74% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2020-12-28T23:30:17.000Z
- Modified: 2026-06-17T03:08:00.227Z
- Weaknesses: CWE-79
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- hedgedoc hedgedoc: < 1.7.1; before 1.7.1

## Every score

- GitHub_M: CVSS:3.1 8.7 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N`
- NVD: CVSS:3.1 8.7 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://github.com/Alemmi/ctf-writeups/blob/main/hxpctf-2020/hackme/solution.md> (exploit, third-party-advisory)
- <https://github.com/hedgedoc/hedgedoc/releases/tag/1.7.1> (third-party-advisory)
- <https://github.com/hedgedoc/hedgedoc/security/advisories/GHSA-g6w6-7xf9-m95p> (third-party-advisory)
- <https://github.com/hackmdio/codimd/issues/1630> (third-party-advisory)
- <https://github.com/hedgedoc/hedgedoc/commit/58276ebbf4504a682454a3686dcaff88bc1069d4> (patch, third-party-advisory)

## Sources

- CVE List: [CVE-2020-26287](https://www.cve.org/CVERecord?id=CVE-2020-26287), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2020-26287](https://nvd.nist.gov/vuln/detail/CVE-2020-26287), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2020-26287 · Whole record: https://cve.day/CVE-2020-26287.json · Rebuilt by cve.day 2026-11-25T22:57:56.500Z
