Summary
Cal.com's booking interface improperly renders user-controlled labels with React's dangerouslySetInnerHTML without sanitization or strong Content Security Policy protections.
An attacker who can create event types with malicious booking question labels can inject arbitrary HTML or JavaScript, which executes in the victim's browser when they visit the public booking page.
Affected context
This vulnerability occurs in Cal.com installations that expose publicly accessible single booking views such as /booking/<id>, where booking questions and labels are rendered directly into the page.
It is most relevant when users are allowed to create or edit event types, especially in self-hosted deployments with open or lightly controlled registration.
The issue manifests when untrusted label content is passed to React's dangerouslySetInnerHTML and displayed to visitors without prior sanitization or robust client-side restrictions.
Exploit preconditions
- Attack surface: Public booking views (e.g.,
/booking/<id>) that display event-specific booking questions and labels. - Required access: Ability to create or modify an event type and define booking question labels (e.g., as an authenticated user on an open registration instance, or through compromised accounts).
- Trigger point: A victim follows a booking link to an affected single booking view where the malicious label is rendered.
- Why exploitation is possible: User-controlled HTML is injected via
dangerouslySetInnerHTMLwithout sanitization or encoding, and there is no effective CSP to block inline script execution, enabling arbitrary JavaScript to run in the victim's browser.
Why this happens
The underlying bug is a classic stored cross-site scripting issue where user input is treated as markup instead of data.
In this case, Cal.com passes booking question labels into React's dangerouslySetInnerHTML which bypasses React's usual automatic encoding safeguards.
Because the content is not validated, sanitized, or strictly encoded, arbitrary script tags or event handlers can be persisted and later rendered, directly mapping to CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
The absence of a restrictive Content Security Policy further amplifies the risk by allowing inline JavaScript to execute without additional browser-level defenses.
Potential impact
- Attackers may execute arbitrary JavaScript in the context of the victim's Cal.com session.
- Malicious scripts could hijack user sessions or exfiltrate authentication tokens and booking-related data.
- Users can be redirected to phishing pages or have arbitrary content injected into the booking experience.
- Browser-side data, including stored credentials or autofill information, could be targeted through social engineering.
- The integrity of the booking interface can be compromised, degrading trust in the platform.
General mitigation guidance
Effective mitigation focuses on treating all user-supplied text as untrusted data and avoiding direct HTML injection patterns.
Preferred defensive approaches include:
- Eliminating or minimizing use of
dangerouslySetInnerHTML, instead rendering labels through standard React components that automatically escape content. - Applying robust server-side and/or client-side HTML sanitization to any content that must support limited markup, enforcing an allowlist of safe tags and attributes.
- Encoding dynamically rendered content by default (e.g., using entity encoding) to prevent it from being interpreted as executable script.
- Defining and enforcing a strict Content Security Policy that blocks inline scripts, restricts script origins, and disallows unsafe dynamic code constructs.
- Limiting who can create or modify event types and labels, and applying moderation or validation workflows where appropriate.
These patterns reduce opportunities for script injection even when attackers can control display text or markup.
How teams detect issues like this
Organizations can identify similar XSS risks by combining static analysis, targeted code review, and runtime monitoring.
Useful strategies include:
- Static analysis rules that flag use of
dangerouslySetInnerHTML, raw HTML insertion APIs, or concatenation of untrusted data into HTML strings. - Code review checklists that require justification and sanitization for any direct HTML rendering, especially for user-controlled fields such as labels, descriptions, or comments.
- Security linters or automated review tools integrated into CI pipelines that detect common XSS anti-patterns and missing encoding or sanitization routines.
- Policy enforcement requiring a default-escape model for templates and React components, and verifying that CSP headers are present and restrictive.
- Runtime monitoring for unusual script behavior on public pages, including detection of injected script tags or suspicious query parameters in booking URLs.
Over time, consistent enforcement of these patterns can significantly reduce the incidence of XSS vulnerabilities.

