Summary
A stored cross-site scripting vulnerability in Etherpad allows attacker-controlled list metadata from a crafted import to be inserted into generated HTML without adequate output encoding. A user with write access to a pad may cause script execution when another user, including an administrator, opens the pad or its timeslider.
Affected context
The vulnerability occurs in Etherpad deployments that process imported pad content and render numbered lists through the affected client-side code. It becomes risky when a user who can write to a pad can influence imported attribute-pool values and another user later views the affected pad or timeslider.
Exploit preconditions
- Attack surface: Etherpad pad and timeslider rendering
- Required access: Write access to a pad and the ability to introduce crafted imported content
- Trigger point: A victim opens the pad or views its timeslider
- Why exploitation is possible: A list start value is interpolated into an unquoted HTML attribute and assigned through
innerHTMLwithout sufficient contextual encoding
Why this happens
The underlying bug is improper neutralization of user-controlled data in dynamically generated HTML, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation. Etherpad constructs an ordered-list element by directly placing an attacker-influenced value into an HTML attribute and then parses the resulting string with innerHTML. Because the value is not safely constrained or encoded for the specific HTML attribute context, browser markup interpretation can turn stored content into executable script.
Potential impact
- Arbitrary script execution in another user's browser session
- Unauthorized actions performed using a victim's Etherpad privileges
- Exposure of pad content or other data available to the victim
- Account or administrative workflow abuse
- Modification of collaborative documents or disruption of editing activity
General mitigation guidance
Mitigation generally focuses on treating imported metadata and pad content as untrusted throughout the rendering pipeline.
Common defensive patterns include:
- Constructing DOM elements with safe property or attribute APIs instead of concatenating HTML strings
- Applying context-aware output encoding before inserting values into markup
- Constraining list attributes to an allowlisted numeric representation
- Validating imported attribute-pool data against a strict schema before storage and rendering
- Minimizing use of
innerHTMLfor values that can be influenced by users - Applying least privilege to pad authors and administrative sessions
- Using browser security controls such as a restrictive Content Security Policy as defense in depth
How teams detect issues like this
Detection can include static analysis for string interpolation into HTML attributes, unsafe innerHTML assignments, and DOM construction that combines trusted markup with imported values. Code review should examine import handlers, attribute-pool processing, list rendering, and every boundary where stored content reaches browser parsing APIs. Policy enforcement can require contextual output encoding, schema validation for imported metadata, and security tests covering stored content in pads and timeslider views. Automated application-security review tools may help identify related DOM-based injection patterns.

