Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2022-31108

published medium CVSS 3.1 · 4.1

Arbitrary `CSS` injection into the generated graph affecting the container HTML in mermaid.js

Published
28 Jun 2022, 18:35:11 UTC
Updated
22 Apr 2025, 17:52:58 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
mermaid-js — mermaid>= 8.0.0, < 9.1.3 Affected Not stated GitHub_M

Description

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.

en · GitHub_M · cna

Vendor advisories explicitly linked to this CVE.

0

No linked advisories were found for this CVE.

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
4.1 / 10
Severity
medium
Provider
GitHub_M · cna
Vector string
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
mermaid-js mermaid >= 8.0.0, < 9.1.3 (affected) GitHub_M · cna

Weaknesses

1
  • CWE-74 CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (GitHub_M · cna)

References

2

Provider assertions

3

GitHub_M · cna

Arbitrary `CSS` injection into the generated graph affecting the container HTML in mermaid.js

CISA-ADP · adp

CISA ADP Vulnrichment

CVE · adp

CVE Program Container

Provenance

Schema
5.1
Searchable
yes
Content hash
1ea171f4f19a9edfd334a5042a29620f3c51d03ed7a341848053535596caabcb
Ingested
23 Sep 2026, 08:00:25 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected