CVE-2022-31108
MEDIUMDescription
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.
How to fix
Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.
CVSS v3 Vector
Exploitability
Impact
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N
Exploit Intelligence
Moderate risk: more likely to be exploited than 54% of all known CVEs.
References
Related Vulnerabilities
Other CWE-74 (Injection) vulnerabilities, ordered by exploit likelihood. View all
| CVE | Severity | CVSS | EPSS | Exploited | Fix |
|---|---|---|---|---|---|
| CVE-2013-2251 | Critical | 9.8 | 100% | KEV | Fix |
| CVE-2023-22527 | Critical | 9.8 | 100% | KEV + Ransom | Fix |
| CVE-2019-2725 | Critical | 9.8 | 100% | KEV + Ransom | Fix |
| CVE-2022-46169 | Critical | 9.8 | 100% | KEV | Fix |
| CVE-2022-35914 | Critical | 9.8 | 100% | KEV | - |
| CVE-2019-17558 | High | 7.5 | 99% | KEV | Fix |
Embed a live status badge for CVE-2022-31108
Markdown
[](https://tridentstack.com/cve/CVE-2022-31108)HTML
<a href="https://tridentstack.com/cve/CVE-2022-31108"><img src="https://tridentstack.com/cve/badge/CVE-2022-31108.svg" alt="CVE-2022-31108"></a>Find and fix vulnerabilities across your fleet
TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.
Start freeThis product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2024-11-21.