CVE-2024-38527 (JSON, published 2024-06-26T20:15Z)
Description: value: ZenUML is JavaScript-based diagramming tool that requires no server, using Markdown-inspired text definitions and a renderer to create and modify sequence diagrams. Markdown-based comments in the ZenUML diagram syntax are susceptible to Cross-site Scripting (XSS). The 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. This puts existing applications that use ZenUML unsandboxed at risk of arbitrary JavaScript execution when rendering user-controlled diagrams. This vulnerability was patched in version 3.23.25,
Severity: nan (CVSS v3 base score: )
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/mermaid-js/zenuml-core
Files changed:
package.json
pnpm-lock.yaml
src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Comment/Comment.vue
Commit message: Fixed an XSS vulnerability.


Vulnerable code:
    version: 20.13.0
    version: 10.9.1(@types/node@20.13.0)(typescript@4.9.4)
    version: 3.2.10(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0)
  /@types/node@20.13.0:
        integrity: sha512-FM6AOb3khNkNIXPnHFDYaHerSv8uN22C91z098AnGccVu+Pcdhi+pNUFDi0iLmPIsVE0JBD0KVS7mzUYt4nRzQ==,
      "@types/node": 20.13.0
      vite: 3.2.10(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0)
      "@types/node": 20.13.0
      "@types/node": 20.13.0
      ts-node: 10.9.1(@types/node@20.13.0)(typescript@4.9.4)
  /ts-node@10.9.1(@types/node@20.13.0)(typescript@4.9.4):
      "@types/node": 20.13.0
  /vite-node@0.26.1(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0):
      vite: 3.2.10(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0)
      vite: 3.2.10(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0)
  /vite@3.2.10(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0):
      "@types/node": 20.13.0
      "@types/node": 20.13.0
      vite: 3.2.10(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0)
      vite-node: 0.26.1(@types/node@20.13.0)(less@4.1.3)(sass@1.57.0)
      return (
        (this.comment && marked.parse(this.comment))
      );

Fixed code:
    "dompurify": "^3.1.5",
  dompurify:
    specifier: ^3.1.5
    version: 3.1.5
    version: 20.14.9
    version: 10.9.1(@types/node@20.14.9)(typescript@4.9.4)
    version: 3.2.10(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0)
  /@types/node@20.14.9:
        integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==,
      "@types/node": 20.14.9
      vite: 3.2.10(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0)
  /dompurify@3.1.5:
    resolution:
      {
        integrity: sha512-lwG+n5h8QNpxtyrJW/gJWckL+1/DQiYMX8f7t8Z2AZTPw1esVrqjI63i7Zc2Gz0aKzLVMYC1V1PL/ky+aY/NgA==,
      }
    dev: false

      "@types/node": 20.14.9
      "@types/node": 20.14.9
      ts-node: 10.9.1(@types/node@20.14.9)(typescript@4.9.4)
  /ts-node@10.9.1(@types/node@20.14.9)(typescript@4.9.4):
      "@types/node": 20.14.9
  /vite-node@0.26.1(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0):
      vite: 3.2.10(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0)
      vite: 3.2.10(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0)
  /vite@3.2.10(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0):
      "@types/node": 20.14.9
      "@types/node": 20.14.9
      vite: 3.2.10(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0)
      vite-node: 0.26.1(@types/node@20.14.9)(less@4.1.3)(sass@1.57.0)
import DOMPurify from "dompurify";

      const dirtyHTML =
        (this.comment && marked.parse(this.comment));
      return DOMPurify.sanitize(dirtyHTML);