GPT-6 Luna · Heavy

add-guest-management-functionality-to-existing-bookings-cal-com

cal.com · TypeScript · M · 100–299 lines · 6 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
2 of 8
Comments published
4
Comments matching a bug
2
Comments not matching
2
Cost of this PR
$0.056

Published comments (4)

highbugpackages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:74-78

Concurrent requests can add duplicate attendee emails — Concurrent requests can both pass this check and create duplicate attendees. Enforce uniqueness atomically or add a database constraint and handle conflicts.

highsecuritypackages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:70-77

Email casing bypasses blacklist and duplicate checks — Case differences can let guests bypass the blacklist or be added twice. Normalize the submitted and stored addresses before comparing them in `uniqueGuests`.

mediumbugpackages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:168

Emails are sent for guests who were not added — Guests who were not inserted can receive normal scheduled emails, making notifications inconsistent with the attendee list. Pass the emails actually inserted to `sendAddGuestsEmails`.

mediumsecuritypackages/trpc/server/routers/viewer/bookings/addGuests.handler.ts:52

Case-sensitive attendee email check denies valid attendees — An attendee whose account email differs only by case can be incorrectly denied authorization. Compare normalized addresses in `isAttendee`.

Gold bugs found (2)

highThe guest blacklist is lowercased but incoming guest emails are compared without normalization, so a blacklisted address submitted with different casing bypasses BLACKLISTED_GUEST_EMAILS and is added and emailed.
mediumThe handler passes the unfiltered guests list to sendAddGuestsEmails, which uses it to pick who gets AttendeeScheduledEmail, so existing attendees included in the request receive a new-booking confirmation instead of the add-guests email.

Gold bugs missed (6)

highisTeamAdminOrOwner combines isTeamAdmin and isTeamOwner with &&, so only team owners pass; team admins who are not organizer or attendee are wrongly rejected with FORBIDDEN.
mediumThe server never deduplicates the guests array, so a request with the same email twice inserts duplicate attendee rows for the booking.
highEventManager is created with the requesting user's credentials, so when a non-organizer adds guests the organizer's calendar event is not updated (or the wrong account is used) for references without a credentialId.
mediumsendAddGuestsEmails ignores the event type's disableStandardEmails settings, so hosts and attendees receive add-guests emails even when standard emails are disabled.
mediumThe add-guests handler omits booking.iCalUID from the CalendarEvent, so the add-guests emails' .ics attachments use booking.uid as UID and recipients' calendars treat them as a new event rather than an update of the original booking invite.
highGuest email uniqueness is checked case-sensitively, so case variants of the same address are accepted as distinct guests (and slip past the lowercased blacklist).