Summary
A stored cross-site scripting (XSS) flaw in Typebot's embed package allows attacker-controlled SVG content to be rendered via Solid's innerHTML without sanitization.
When a malicious typebot is imported or crafted by a collaborator, arbitrary HTML and JavaScript can run in the authenticated builder context, enabling session hijacking and privilege escalation within the builder application.
Affected context
The vulnerability affects Typebot instances using versions 3.15.2 and earlier where:
- The RatingButton component from the embed package is available and rendered in the builder preview.
- The
customIcon.svgfield can be influenced by imported bots or collaborators. - Builder previews are rendered inline on
builder.typebot.iounder a Content Security Policy that allowsunsafe-inline.
In this context, rating blocks are not treated as unsafe content, so their icon HTML is not sanitized or isolated in a sandbox, leaving the builder UI exposed to attacker-supplied markup.
Exploit preconditions
- Attack surface: Typebot builder interface and preview rendering of bots containing RatingButton components.
- Required access: Ability to introduce or modify a bot definition that will be opened in the builder (e.g., via import, shared template, or collaborator access).
- Trigger point: A builder user opens or previews a malicious bot containing a RatingButton whose
customIcon.svgfield includes crafted HTML/JavaScript. - Why exploitation is possible: The RatingButton component injects the
customIcon.svgvalue directly into the DOM using Solid'sinnerHTML, with no sanitization, while the relevant rating blocks are not flagged asisUnsafe. The builder renders on its own origin under a CSP that permits inline script execution, and this path bypasses the Web Worker sandbox used for Script blocks.
Why this happens
The issue originates from an unsafe DOM injection pattern where user-controlled markup is written directly into the page via innerHTML without sanitization.
Although DOMPurify is present and actively used elsewhere (such as in StreamingBubble.tsx), the RatingButton component's customIcon.svg field is treated as trusted and not fed through the sanitizer.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, where attacker-controlled data is interpreted as active content in a browser context.
The additional design assumption that rating blocks are not "unsafe" allowed this HTML injection path to bypass existing sandboxing and content isolation mechanisms.
Potential impact
- Theft of builder session cookies or tokens, leading to account takeover within the builder.
- Execution of arbitrary JavaScript in the context of
builder.typebot.io. - Privilege escalation by performing actions as the compromised builder user (e.g., modifying bots, accessing sensitive configuration data).
- Persistent compromise of project resources through backdoored or altered typebots.
- Pivoting to other integrated systems if the builder account has connected services or secrets.
General mitigation guidance
Effective mitigation centers on consistently treating all user-supplied markup as untrusted and minimizing direct DOM injection:
- Route all HTML- or SVG-like content through a well-configured HTML sanitizer (such as DOMPurify) before rendering, ensuring dangerous tags, attributes, and event handlers are stripped.
- Avoid using
innerHTMLor equivalent raw HTML bindings for user-provided content; prefer declarative templates or safe component APIs where possible. - Classify components like rating blocks as potentially unsafe when they can carry attacker-influenced HTML, and subject them to the same isolation and sanitization rules as scriptable blocks.
- Tighten CSP policies to reduce reliance on
unsafe-inlinewhere feasible, favoring nonces or hashes for permitted scripts. - Limit the privileges of builder sessions and ensure sensitive actions require additional verification or scoped tokens, reducing the blast radius if XSS occurs.
How teams detect issues like this
Organizations can identify and monitor for this class of issue by:
- Applying static analysis or linters that flag direct
innerHTML,dangerouslySetInnerHTML, or similar raw HTML bindings, especially when fed by user or imported data. - Adding code review checklists that require explicit justification and sanitization for any feature rendering dynamic HTML or SVG.
- Enforcing architectural policies that route all rich-text or markup-bearing fields through a shared sanitization utility, and validating this in automated tests.
- Implementing security-focused integration tests that attempt to inject basic XSS payloads through customizable UI elements and verify they are neutralized.
- Using web application firewalls and browser security reports (e.g., CSP violation reports) to detect suspicious inline script execution patterns in production.

