Summary
Hoppscotch contained a stored cross-site scripting (XSS) vulnerability where attacker-controlled input could be saved and later executed in the browser of other users.
When triggered, this script execution could be abused to perform cross-site request forgery (CSRF)-style actions in the context of the victim's authenticated Hoppscotch session.
Affected context
The vulnerability affects Hoppscotch components that persist user-supplied data and later render it into web views seen by other users without consistently applying output encoding.
This typically involves shared or collaborative areas of the application where one user's input is stored on the server and subsequently displayed in other users' browsers in an HTML context.
The issue is more risky in deployments where multiple users share workspaces or resources and where authentication cookies or tokens are automatically sent with Hoppscotch requests.
Exploit preconditions
- Attack surface: Web interface of Hoppscotch, specifically features that store and later render user-generated content.
- Required access: Ability to create or edit content within a Hoppscotch instance (e.g., shared collections, environments, or other collaborative artifacts).
- Trigger point: A victim user visits a page or view that renders the malicious stored content in their browser.
- Why exploitation is possible: The application stores untrusted input and later inserts it into an HTML/JavaScript context without robust context-aware output encoding or sanitization, allowing attacker-supplied script to execute in the victim's browser. Once active, the script inherits the victim's session and can issue unauthorized requests (CSRF-like behavior).
Why this happens
This vulnerability stems from improper neutralization of input before it is included in web pages, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).
The application logic accepts and persists user-controlled data, but when rendering this data back to the client, it fails to enforce strict output encoding or sanitization tailored to the specific HTML/JavaScript context.
As a result, attacker-controlled markup or script fragments can break out of the intended data context and execute as active script within the victim's browser, enabling session-bound actions that resemble CSRF.
Potential impact
- Execution of arbitrary JavaScript in the victim's browser within the Hoppscotch origin
- Unauthorized actions performed on behalf of the victim (CSRF-style interactions)
- Theft or misuse of session identifiers, API tokens, or sensitive in-app data accessible to the victim
- Manipulation of API development data, such as modifying or exfiltrating collections, environments, or request definitions
- Lateral movement within a shared workspace by impersonating other users' sessions
General mitigation guidance
Effective mitigation centers on strict output encoding and minimizing trust in persisted user content:
- Apply context-aware output encoding for all user-supplied data when rendering into HTML, attribute, URL, JavaScript, or CSS contexts.
- Favor UI components and templating mechanisms that auto-escape content by default, avoiding raw HTML insertion APIs.
- Enforce input validation and normalization to constrain allowed content types where rich HTML is not strictly required.
- Introduce content sanitization for any feature that must support rich text, allowing only a minimal, well-defined subset of safe markup.
- Harden CSRF defenses separately (e.g., state-changing requests requiring strong anti-CSRF mechanisms and re-validation of user intent), so that even if XSS occurs, its ability to perform unauthorized actions is reduced.
- Adopt a principle of least privilege in session and token scope, limiting the damage from any single compromised browser context.
How teams detect issues like this
Detection typically combines code-level analysis and behavior-focused review:
- Use static analysis or linters to flag dangerous HTML rendering patterns, such as direct insertion of user input into template literals, DOM APIs, or innerHTML-like sinks.
- During code review, look for flows where persisted data is displayed without a clear encoding step or where escape mechanisms are explicitly disabled.
- Implement security-focused UI tests that attempt to store benign XSS test payloads and then verify that they are rendered as inert text rather than executing.
- Incorporate automated security scanning tools (DAST/SAST) into CI pipelines to identify XSS-like patterns across the codebase and rendered pages.
- Monitor application logs and client-side error metrics for anomalous script execution or unexpected DOM manipulation originating from stored content fields.

