8.7high
Stored XSS in mermaid diagrams
- Severity
- 8.7high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.46% (higher than 74% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| hedgedoc hedgedoc | < 1.7.1, before 1.7.1 | CVE List, NVD |
All scores
| GitHub_M | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
| NVD | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
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.
NVD (es)
HedgeDoc es una plataforma colaborativa para escribir y compartir rebajas. En HedgeDoc versiones anteriores a 1.7.1, un atacante puede inyectar etiquetas "script" arbitrarias en las notas de HedgeDoc usando diagramas mermaid. Nuestra política de seguridad de contenido evita una carga de scripts de la mayoría de las ubicaciones, pero se permite "www.google-analytics.com" Usando Google Tag Manager, es posible inyectar JavaScript arbitrario y ejecutarlo al cargar la página. Dependiendo de la configuración de la instancia, es posible que el atacante no necesite autenticación para crear o editar notas. El problema está parcheado en HedgeDoc versión 1.7.1. Como solución alternativa, se puede rechazar "www.google-analytics.com" en el encabezado "Content-Security-Policy". Tome en cuenta que pueden presentar otras formas de aprovechar la inyección de etiquetas "script"
References
| 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/Alemmi/ctf-writeups/blob/main/hxpctf-2020/hackme/solution.md | exploit, third-party-advisory | |
| https://github.com/hedgedoc/hedgedoc/commit/58276ebbf4504a682454a3686dcaff88bc1069d4 | patch, third-party-advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-26287 changed 2024-08-04 | CVE Terms of Use |
| NVD | CVE-2020-26287 changed 2026-06-17 | Public domain |