CVE-2024-38527: @zenuml/core Cross-Site Scripting Vulnerability
MODERATECVE-2024-38527 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting @zenuml/core libraries in the npm ecosystem. The issue involves cross-site scripting in zenuml. Remediation is available by upgrading affected packages to version 3.23.25.
CVE-2024-38527 at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2024-38527
To remediate this vulnerability, upgrade all affected @zenuml/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @zenuml/core@3.23.25
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @zenuml/core
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-38527, inspect your project dependencies using npm:
npm ls @zenuml/core
Analyze the terminal output to locate any version of @zenuml/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.23.25), your application is affected.
Note: The npm ls @zenuml/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In @zenuml/core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-38527 Affected @zenuml/core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@zenuml/core
|
npm |
< 3.23.25
|
3.23.25
|
References
Frequently Asked Questions
What is CVE-2024-38527?
Which @zenuml/core versions are affected?
What version fixes CVE-2024-38527?
Is @zenuml/core affected?
What is the CVSS score of CVE-2024-38527?
What CWE is associated with CVE-2024-38527?
How can I check npm dependencies for CVE-2024-38527?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q6xv-jm4v-349h",
"modified" : "2024-06-26T21:56:14Z",
"published" : "2024-06-26T19:03:54Z",
"aliases" : [ "CVE-2024-38527" ],
"summary" : "Cross-site Scripting in ZenUML",
"details" : "### Summary\n\nMarkdown-based comments in the ZenUML diagram syntax are susceptible to Cross-site Scripting (XSS).\n\n### Details\n\nThe comment feature allows the user to attach small notes for reference. This feature allows the user to enter in their comment in markdown comment, allowing them to use common markdown features, such as `**` for bolded text. However, the markdown text is currently not sanitized before rendering, allowing an attacker to enter a malicious payload for the comment which leads to XSS.\n\nhttps://github.com/mermaid-js/zenuml-core/blob/dcfee8cde42673c09e19401f43ad8506658c8442/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Comment/Comment.vue#L65\n\n### PoC\n\n```\n// p<img onerror=alert(1) src=\"\"/>\nA->B:hi\n```\n\nAbove is a POC diagram payload that results in an XSS.\n\nHere is a similar POC in mermaid.live: https://mermaid.live/edit#pako:eNpNjrFuwyAQhl8F3dRK1DaQGhs1kVq1Y6duFQsylwTVgEWw1MTyuxc5S7df39399y0wRIug4IZh9qMOdU2mF-dPJAZMKaa9GTHlB_ZILmnYa9BQH3R4fTq8qbMDCh6TN86WhkUHQjTkM3rUoEq0Jv2Ui7CWPTPn-HUNA6icZqQwT9ZkfHfmlIwHdTTjpVC0Lsf0eVfazChMJoBa4BdUL6uGC8n7TrCGd5zCFRRnXbVjvBVNK3gJXbtSuMVYSlnFC-Kyf961UshWbmXf2-y_xcf29c7WP2yrVC0\n\n### Impact\n\nThis puts existing applications that use ZenUML **unsandboxed** at risk of arbitrary JavaScript execution when rendering user-controlled diagrams.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@zenuml/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.23.25"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mermaid-js/zenuml-core/security/advisories/GHSA-q6xv-jm4v-349h"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38527"
}, {
"type" : "WEB",
"url" : "https://github.com/mermaid-js/zenuml-core/commit/ad7545b33f5f27466cbf357beb65969ca1953e3c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mermaid-js/zenuml-core"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-80" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-26T19:03:54Z",
"nvd_published_at" : "2024-06-26T20:15:16Z"
}
}