Summary
Waline's UserList widget inserts commenter names and links into the page without HTML escaping, allowing a submitted comment to store script-capable content. When a page displaying the widget is viewed, that content may execute in each visitor's browser without further interaction.
Affected context
The issue affects Waline versions 3.15.2 and prior when the @waline/client UserList widget renders commenter data returned by the server. The commenter nick and link are returned verbatim and concatenated into root.innerHTML; unlike the comment body, these fields are not sanitized, and the link field is not sent to the spam filter. Risk depends on a page embedding the widget and displaying the affected commenter data.
Exploit preconditions
- Attack surface: A Waline instance accepting comments and a page that embeds the UserList widget.
- Required access: The described attack does not require authentication; a visitor must be able to submit a comment.
- Trigger point: The widget renders server-returned commenter fields in a visitor's browser.
- Why exploitation is possible: The nick and link values can be stored and returned without HTML escaping, then inserted into the DOM as HTML.
Why this happens
The underlying bug is improper neutralization of untrusted input in an HTML output context. Concatenating commenter-controlled values into innerHTML without context-appropriate encoding or safe DOM construction maps to CWE-79: Improper Neutralization of Input During Web Page Generation. It is also related to CWE-116, which covers improper encoding or escaping of output.
Potential impact
- Stored content may execute script in the browsers of visitors viewing an affected UserList.
- An attacker could potentially access or act on data available to the affected page, subject to browser and application controls.
- The issue may undermine trust in pages that embed the widget or expose visitors to deceptive content.
General mitigation guidance
Defensive patterns include avoiding HTML-string construction with untrusted values and using safe DOM APIs that treat commenter data as text. Apply context-appropriate output encoding to every untrusted field, including names and links, and validate link values against an explicit, restrictive policy. Treat server-returned data as untrusted, regardless of whether it has passed other filters, and apply least privilege to any exposed application capabilities.
How teams detect issues like this
- Use static analysis to identify flows from server-returned or user-controlled fields into
innerHTMLand other HTML-parsing sinks. - Review rendering code for string concatenation involving commenter names, links, and other untrusted fields.
- Add tests that verify rendered text is inert and link values follow an allowlist policy.
- Enforce code-review or CI policies that prohibit unsafe HTML sinks or require approved sanitization and encoding patterns.

