Summary
Cal.com Cal.diy contains a stored cross-site scripting vulnerability in the BookingPageTagManager component, where an authenticated event owner can place unsanitized JavaScript in an analytics tracking ID. The script may execute in the browser of visitors to the affected public booking page, enabling session theft, forged requests, and propagation to other events when additional conditions are present.
Affected context
The issue occurs in Cal.com Cal.diy versions 2.1.1 through 6.2.0 when an event owner can configure an analytics tracking identifier for a public booking page. Risk exists when that value is embedded into an inline script without context-appropriate validation or output encoding, allowing the stored value to execute for page visitors.
Exploit preconditions
- Attack surface: Public booking pages rendered by the BookingPageTagManager component
- Required access: Authenticated permissions to create or manage an event and its analytics tracking configuration
- Trigger point: A visitor loads an affected public booking page
- Why exploitation is possible: The tracking identifier is stored and later inserted into an inline JavaScript context without adequate sanitization or encoding
Why this happens
The underlying bug is a failure to treat an analytics tracking identifier as untrusted data before embedding it in executable JavaScript. A value that crosses a script-string boundary can alter the surrounding program and cause browser-side code execution. This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.
Potential impact
- Attackers may steal accessible session information or other page data
- Attackers could forge authenticated requests in a victim's browser
- User actions and booking-related data may be modified
- A malicious payload can spread to additional events when chained with writable or CSRF-affected functionality
- Public booking pages may be used to target multiple visitors
General mitigation guidance
Mitigation generally focuses on reducing trust in tracking configuration values and preventing data from entering executable contexts.
Common defensive patterns include:
- Validate analytics identifiers against a strict allowlist and expected format
- Avoid constructing inline JavaScript from user-controlled values
- Prefer non-executable data attributes or trusted API integrations for analytics configuration
- Apply context-aware output encoding when values must be rendered
- Use a restrictive Content Security Policy that limits inline script execution
- Apply least privilege to event-management roles and limit who can alter public-page settings
- Use CSRF protections and authorization checks on state-changing event-management endpoints
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis rules that identify user-controlled data entering inline script blocks
- Code review checks for string interpolation or concatenation inside JavaScript contexts
- Tests that submit metacharacters and verify that rendered values remain inert
- Inventory and monitoring of event analytics configuration changes
- Content Security Policy violation reporting for unexpected script execution
- Policy enforcement requiring context-aware output encoding and approved analytics integration patterns
Automated security review tools may help identify dangerous data flows, but findings should be confirmed against the rendering context and authorization model.

