Add guest management functionality to existing bookings#2
Open
adamsaimi wants to merge 1 commit intoguest-management-basefrom
Open
Add guest management functionality to existing bookings#2adamsaimi wants to merge 1 commit intoguest-management-basefrom
adamsaimi wants to merge 1 commit intoguest-management-basefrom
Conversation
* feat: ability to add guests via app.cal.com/bookings * fix: some update * fix: minor issue * fix: final update * update * update * add requested changes * fix type error * small update * final update * fix type error * fix location * update calender event --------- Co-authored-by: Somay Chauhan <somaychauhan98@gmail.com>
adamsaimi
commented
Oct 25, 2025
| }; | ||
| input: TAddGuestsInputSchema; | ||
| }; | ||
| export const addGuestsHandler = async ({ ctx, input }: AddGuestsOptions) => { |
Owner
Author
There was a problem hiding this comment.
[Security] Missing Rate Limiting for addGuests
- Problem: The
addGuestsendpoint lacks rate limiting, making it vulnerable to abuse and potential denial of service. - Fix: Implement robust rate limiting on this endpoint to restrict the number of requests a user can make within a given timeframe.
adamsaimi
commented
Oct 25, 2025
| if (!booking) throw new TRPCError({ code: "NOT_FOUND", message: "booking_not_found" }); | ||
|
|
||
| const isTeamAdminOrOwner = | ||
| (await isTeamAdmin(user.id, booking.eventType?.teamId ?? 0)) && |
Owner
Author
There was a problem hiding this comment.
[Bug] Incorrect Authorization Logic for Team Members
- Problem: The authorization logic
(await isTeamAdmin(...)) && (await isTeamOwner(...))is overly restrictive, andteamId ?? 0may lead to incorrect permission checks. - Fix: Change
&&to||to allow either admins or owners, and ensureteamIdis a valid identifier without defaulting to0.
adamsaimi
commented
Oct 25, 2025
|
|
||
| const isOrganizer = booking.userId === user.id; | ||
|
|
||
| const isAttendee = !!booking.attendees.find((attendee) => attendee.email === user.email); |
Owner
Author
There was a problem hiding this comment.
[Security] Broad Attendee Guest Management Privilege
- Problem: The
isAttendeecheck allows any attendee to add guests, which could be abused for spam or disruption. - Fix: Re-evaluate this privilege; if not intended, remove
isAttendeefrom authorization, or add safeguards like organizer approval or guest limits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test 10