Summary
Rocket.Chat contains a stored cross-site scripting vulnerability in the Livechat visitor API, where an unauthenticated name value is saved without adequate sanitization and later rendered as HTML.
An attacker may use this behavior to place a deceptive, clickable link and social-engineering content in the Omnichannel Queue visible to agents. The risk arises when an agent views a queue containing the attacker-controlled visitor entry.
Affected context
The issue occurs in Rocket.Chat deployments where the Livechat visitor creation endpoint accepts visitor names without authentication and stores them in a form that is later rendered through an HTML-capable client-side component. It is particularly relevant to Omnichannel environments where agents view visitor names in the queue and where browser security controls do not fully prevent interaction with attacker-controlled links or markup.
Exploit preconditions
- Attack surface: The unauthenticated Livechat visitor REST API
- Required access: Ability to submit a visitor name to the endpoint; no agent credentials are required to create the entry
- Trigger point: An agent views the affected visitor entry in the Omnichannel Queue side panel
- Why exploitation is possible: The submitted name is stored without sufficient sanitization and later inserted into the browser DOM as HTML rather than being rendered strictly as text
Why this happens
The underlying flaw is insufficient output encoding and sanitization of user-controlled data before rendering it in an HTML-capable frontend component. A visitor name is treated as trusted markup and passed to a rendering path using dangerouslySetInnerHTML, allowing attacker-controlled HTML content to become part of an agent's browser DOM.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting. The stored nature of the data means the malicious content persists until it is displayed to users, rather than requiring the attacker to target each viewer directly.
Potential impact
- An attacker may display deceptive links or social-engineering messages to agents.
- Agents could be redirected to attacker-controlled domains and exposed to credential-phishing attempts.
- Malicious content could abuse the privileges and trust associated with an agent's browser session.
- The vulnerability could contribute to unauthorized actions, data exposure, or account compromise depending on browser protections and application behavior.
- Security monitoring and support workflows could be disrupted by misleading queue entries.
General mitigation guidance
Mitigation generally focuses on treating visitor-controlled fields as plain text and reducing trust in data that crosses from the API into the browser.
Common defensive patterns include:
- Rendering visitor names through framework-safe text interpolation instead of raw HTML insertion.
- Applying context-appropriate output encoding and allowlist-based sanitization where limited markup is genuinely required.
- Validating and normalizing URL-bearing values, with restrictive link policies and safe handling of external destinations.
- Enforcing a strong Content Security Policy and related browser protections as defense in depth.
- Limiting the privileges available to agent sessions and separating sensitive administrative actions from ordinary queue interactions.
- Applying consistent sanitization and encoding at every display context rather than relying only on API-side validation.
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying
dangerouslySetInnerHTML, raw DOM insertion, and template rendering of request or database values. - Code review checks that trace visitor-controlled fields from API handlers through storage and frontend rendering.
- Tests that submit markup-like and URL-bearing values, then verify that the interface displays them as inert text.
- Runtime monitoring for unusual visitor creation activity, suspicious names, external-domain links, or repeated submissions.
- Frontend security policies that flag unsanitized HTML rendering and enforce approved sanitization libraries.
Automated application security and code review tools may help identify raw HTML sinks, but manual data-flow review remains important for stored content.

