Security mailing lists by PureSourceCode

CVE-2022-31108

MEDIUM 6.1CVSS 3.1

Possible inject arbitrary `CSS` into the generated graph affecting the container HTML

Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. An attacker is able to inject arbitrary CSS into the generated graph allowing them to change the styling of elements outside of the generated graph, and potentially exfiltrate sensitive information by using specially crafted CSS selectors. The following example shows how an attacker can exfiltrate the contents of an input field by bruteforcing the value attribute one character at a time. Whenever there is an actual match, an http request will be made by the browser in order to "load" a background image that will let an attacker know what's the value of the character. This issue may lead to Information Disclosure via CSS selectors and functions able to generate HTTP requests. This also allows an attacker to change the document in ways which may lead a user to perform unintended actions, such as clicking on a link, etc. This issue has been resolved in version 9.1.3. Users are advised to upgrade. Users unable to upgrade should ensure that user input is adequately escaped before embedding it in CSS blocks.

Published
28 Jun 2022
Last modified
17 Jun 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-74CWE-79
Also known as
GHSA-x3vm-38hw-55wf
Sources
NVDJSONOSV GHSA-x3vm-38hw-55wfJSON

Scores

SourceScored byVersionScoreVector / decision
NVD nvd@nist.gov (Primary) CVSS 3.1 MEDIUM 6.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD security-advisories@github.com (Secondary) CVSS 3.1 MEDIUM 4.1 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N
OSV GitHub CVSS 3.1 MEDIUM 4.1 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N
NVD nvd@nist.gov (Primary) CVSS 2.0 MEDIUM 5.8 AV:N/AC:M/Au:N/C:P/I:P/A:N

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD mermaid_project mermaid
cpe:2.3:a:mermaid_project:mermaid:*:*:*:*:*:node.js:*:*
>= 8.0.0, < 9.1.3 9.1.3
OSV npm mermaid >= 8.0.0, < 9.1.2 9.1.2

References

History

  • 25 Nov 2026 20:34 UTC · NVD: first stored (published 28 Jun 2022)
  • 25 Nov 2026 20:11 UTC · OSV: first stored (published 5 Jul 2022)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.