CVE-2020-26287: Stored XSS in mermaid diagrams
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 Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2020-26287?
CVE-2020-26287 has a medium severity rating as it allows for script injection into HedgeDoc notes.
How do I fix CVE-2020-26287?
To fix CVE-2020-26287, upgrade HedgeDoc to version 1.7.1 or later.
What types of attacks are possible with CVE-2020-26287?
CVE-2020-26287 allows attackers to inject and execute arbitrary scripts in HedgeDoc notes.
Which versions of HedgeDoc are affected by CVE-2020-26287?
CVE-2020-26287 affects all HedgeDoc versions prior to 1.7.1.
Is there a workaround for CVE-2020-26287 if I cannot update?
There are no official workarounds for CVE-2020-26287; updating to a secure version is recommended.