Skip to content

Conversation

@adamsaimi
Copy link
Owner

Test 10

* 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>
};
input: TAddGuestsInputSchema;
};
export const addGuestsHandler = async ({ ctx, input }: AddGuestsOptions) => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Security] Missing Rate Limiting for addGuests

  • Problem: The addGuests endpoint 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.

if (!booking) throw new TRPCError({ code: "NOT_FOUND", message: "booking_not_found" });

const isTeamAdminOrOwner =
(await isTeamAdmin(user.id, booking.eventType?.teamId ?? 0)) &&
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Bug] Incorrect Authorization Logic for Team Members

  • Problem: The authorization logic (await isTeamAdmin(...)) &amp;&amp; (await isTeamOwner(...)) is overly restrictive, and teamId ?? 0 may lead to incorrect permission checks.
  • Fix: Change &amp;&amp; to || to allow either admins or owners, and ensure teamId is a valid identifier without defaulting to 0.


const isOrganizer = booking.userId === user.id;

const isAttendee = !!booking.attendees.find((attendee) => attendee.email === user.email);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Security] Broad Attendee Guest Management Privilege

  • Problem: The isAttendee check allows any attendee to add guests, which could be abused for spam or disruption.
  • Fix: Re-evaluate this privilege; if not intended, remove isAttendee from authorization, or add safeguards like organizer approval or guest limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants