/

CVE-2024-58353

Severity:

HIGH RISK

(8.9)

Stored XSS (CWE-80) in Cal.com public booking pages

CVE-2024-58353

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-80

Impact:

Client-Side Code Execution and Session Compromise

Severity:

HIGH RISK

(8.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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 dangerouslySetInnerHTML without 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.

Sources

SourceLink
github.comgithub.com/calcom/cal.diy/commit/00689fda0a30b8f933c096f02c1fe092a4206def
github.comgithub.com/calcom/cal.diy/security/advisories/GHSA-vgj7-76cw-h6f8
vulncheck.comvulncheck.com/advisories/cal-com-through-cross-site-scripting-via-booking-questions

Frequently asked

questions

This vulnerability is broadly exploitable wherever attackers can create or configure event types that include booking question labels. Once malicious labels are stored, any user who visits the corresponding public booking page can be targeted, making it a stored XSS that can impact many victims.

An attacker generally needs the ability to create or modify event types on the affected Cal.com instance. On self-hosted deployments with open registration, obtaining such access may be trivial, whereas more tightly controlled environments reduce the pool of potential attackers.

The safest pattern is to avoid rendering untrusted content as HTML altogether. Use React's default escaped rendering, remove or strictly limit use of dangerouslySetInnerHTML, and apply strong HTML sanitization for any feature that genuinely requires limited markup, combined with a strict CSP that blocks inline scripts.

Preventing similar issues requires a combination of secure coding and architectural practices: adopt a "escape-by-default" templating model, forbid direct HTML injection from user input, incorporate sanitization libraries where markup is necessary, enforce restrictive CSP headers, and use automated security checks in CI to flag XSS-prone coding patterns before deployment.

Find out what's already
exploitable in your codebase.