Impact
In Docmost versions 0.3.0 through 0.23.2, Mermaid code blocks are rendered by the frontend using mermaid.render(), which returns SVG/HTML. That output is inserted into the page via dangerouslySetInnerHTML without any sanitization. The Mermaid API supports in‑diagram %%{init}%% directives that can change securityLevel and enable htmlLabels, permitting an attacker to embed arbitrary HTML or JavaScript. Once a victim views a page containing such a malicious Mermaid block, the code runs in the victim’s browser, potentially compromising confidentiality, integrity, or availability of the user session or data. This is a classic stored XSS flaw, classified as CWE‑79 and CWE‑116. The likely attack vector is a victim opening a page that contains a malicious Mermaid diagram, as inferred from the described stored nature of the flaw. Based on the description, it is inferred that an attacker must create or modify a Mermaid diagram and populate it within a page that a target can view. The flaw is enabled by Mermaid per‑diagram %%{init}%% directives that allow an attacker to override securityLevel and enable htmlLabels, thereby injecting arbitrary HTML or JavaScript. The vulnerability enables arbitrary code execution in the context of any user who views the affected page, allowing the compromise of the user session and potentially data accessed by that session.
Affected Systems
The vulnerability is present in the open‑source collaborative wiki software Docmost. All deployments of Docmost from version 0.3.0 up to and including 0.23.2 are affected. Version 0.24.0 and later contain the fix.
Risk and Exploitability
The CVSS score of 6.3 indicates moderate severity, while the EPSS score of less than 1% suggests a low likelihood of active exploitation at this time. The vulnerability is not listed in CISA’s KEV catalog. Based on the description, it is inferred that an attacker would need to create or modify a Mermaid diagram in a page that the victim can view. Because the flaw is stored, any user who opens the document can be compromised, making the risk significant for shared or public sites. Prompt patching reduces the attack surface and mitigates the potential for widespread compromise.
OpenCVE Enrichment