Skip to content

XSS via booking view questions

High
PeerRich published GHSA-vgj7-76cw-h6f8 Dec 4, 2024

Package

No package listed

Affected versions

<=4.7.15

Patched versions

None

Description

Summary by xyzeva

In Cal, the single booking view accessible via https://app.cal.com/booking/<id> globally accessible by everyone can be weaponized for Cross Site Scripting (XSS)

Details

The Cal codebase uses dangerouslySetInnerHTML for field labels on the single booking page, allowing for arbitrary html including script tags with no CSP.

PoC

  1. Create a new event type on Cal
  2. Go to Advanced and add a new booking question with a malicious label
  3. Book a meeting with yourself
  4. Grab the URL of the completed page
  5. Send the URL to victims
  6. Profit!

Summary by Peer Richelsen

3rd December XSS Vulnerability found

Pentester xyz3vaIn (x.com/@xyz3vaIn) discovered and reported a vulnerability related to Cross-Site Scripting (XSS) in our booking form system. This vulnerability was present in versions prior to v4.7.16, where the use of dangerouslySetInnerHTML in the booking form label field inadvertently opened a pathway for malicious script injection.

What Happened?

The issue arose from improper sanitization of user inputs in the booking form labels. dangerouslySetInnerHTML is a React attribute that allows raw HTML to be inserted into the DOM, intended for controlled use where developers are certain about the safety of the HTML content. However, in this case, it was exploited because the input wasn't adequately validated or escaped, allowing rogue users to inject JavaScript code into the label.

Upon submitting a booking form, an attacker could craft a payload within the label text. This payload, when clicked by an unsuspecting user, could execute malicious scripts. The potential harm included:

  • Fetching user data.

  • Stealing API keys or other sensitive information stored in the browser's local storage or cookies.

Impact Assessment

Our extensive review and analysis of logs indicate that no customer data was compromised. The vulnerability required a user-initiated action (clicking on a maliciously crafted link), which was not exploited in any recorded instance.

Who Was At Risk?

  • Cal.com users receiving a malicious link that injected a script

    • Fortunately, we have not found any evidence in our logs that this happened
  • Self-hosters with an Open Registration Form: Only those running our platform on their own servers with public registration enabled might be at risk, since the attacker needs to create an Event-Type with with the malicious XSS script as a Booking Question label.

  • Internal Use: For those using the self-hosted core internally within organizations, the risk is very low since external access was restricted. Without having access to the instance, an attacker could not create a booking question, thereby not execute the XSS. However, updating was still recommended to prevent any internal misuse of employees or accidental exposure.

The Fix and Next Steps

We've addressed this vulnerability in version v4.7.16:

  • Sanitization: Enhanced input sanitization processes to prevent script injection.

  • Secure Practices: Updated guidance for developers on the safe use of dangerouslySetInnerHTML, emphasizing input validation and escaping.

For Self-hosters:

  • Immediate Upgrade: If you have an open platform where external users can sign up, we strongly recommend upgrading to v4.7.16 or later immediately to protect against this vulnerability. If you use a self-hosted instance internally for your team you are less at risk, an update is still recommended.

General Advice:

  • Always keep your software updated to the latest version to benefit from security patches.

  • If you're unsure about your version or need assistance with the upgrade, reach out to our support team.

Conclusion

While no breaches were detected, this incident serves as a reminder of the importance of secure coding practices and the vigilance required in software development. We apologize for any concern this may have caused and thank our users for their trust and support as we work to maintain a secure environment for all.

We are thankful for x.com/xyz3vaIn for the report and assitance.

Stay secure, and thank you for using our platform.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L

CVE ID

No known CVE

Weaknesses

Credits