Summary
A stored cross-site scripting vulnerability in Outline's comment mention feature allows unvalidated href attributes on user mentions to include dangerous protocols such as javascript:.
When other users view comments containing these crafted mentions, attacker-controlled client-side code can execute in their browser, potentially compromising accounts and session data.
Affected context
This vulnerability occurs in Outline deployments using versions 0.84.0 through 1.6.1 where collaborative comments are enabled and users can mention other users.
The backend accepts and persists the href associated with user mentions without validating the protocol or sanitizing unsafe schemes.
When comments are rendered in the browser, these unsafe links are presented as legitimate user mention hyperlinks, creating a persistent client-side attack vector.
Exploit preconditions
- Attack surface: Web UI of the Outline application, specifically the comment section where mentions appear.
- Required access: Ability to create or edit comments that contain user mentions (typically any authenticated user with comment permissions).
- Trigger point: A victim user views a comment containing a crafted mention whose href uses a dangerous protocol (e.g.,
javascript:). - Why exploitation is possible: The server does not validate or sanitize the href attribute for mentions, allowing arbitrary protocols and script-capable URLs to be stored and rendered, which can be executed by the browser when interacted with or in certain rendering contexts.
Why this happens
The root cause is insufficient output handling for dynamically generated links within user mentions, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).
The backend logic responsible for persisting and returning mention metadata does not constrain the href attribute to safe protocols (such as https: or mailto:) and does not neutralize or reject dangerous schemes.
As a result, untrusted user-controlled data flows directly into link attributes in the rendered HTML, enabling execution of attacker-controlled script in the context of the application's origin.
Potential impact
- Theft of session tokens, CSRF tokens, or other sensitive data accessible via the browser context.
- Execution of arbitrary JavaScript in victims' browsers under the trusted Outline origin.
- Unauthorized actions performed on behalf of victims (e.g., modifying documents, changing settings, managing users) via script-driven requests.
- Defacement of content or injection of phishing interfaces within the application UI.
- Pivoting into broader organizational accounts or SSO providers by abusing authenticated user context.
General mitigation guidance
Mitigation generally focuses on strict output encoding and protocol validation for user-controlled links:
- Enforce an allowlist of safe URL schemes for href attributes (e.g.,
https:,http:,mailto:,tel:) and reject or strip anything else. - Normalize and validate mention metadata on the server side before storage and again before rendering.
- Apply robust output encoding for all user-controlled data inserted into HTML, including attribute contexts, to prevent script execution.
- Treat rich-text features (mentions, links, embeds) as untrusted input and process them through a sanitization pipeline designed for HTML and URL contexts.
- Limit the privileges available from a browser session (e.g., apply least-privilege design and defense-in-depth controls) so that a successful XSS has reduced impact.
How teams detect issues like this
Detection can rely on a combination of code-level review and runtime monitoring:
- Use static analysis rules and linters that flag direct insertion of user-controlled data into href and other sensitive attributes without validation or encoding.
- During code review, trace data flows from comment input and mention construction to HTML rendering templates or React components, ensuring protocol checks and encoding steps are present.
- Implement security-focused tests (unit and integration) that cover edge cases like
javascript:,data:, and other non-HTTP schemes in mention links. - Employ Content Security Policy (CSP) reporting modes to surface unexpected inline script execution or dangerous URL usage as a signal of potential XSS issues.
- Use automated application security testing tools capable of generating and detecting stored XSS payloads in collaborative and comment workflows.

