Skip to content

fix(event): close attendee-management IDOR on delete/update routes#587

Merged
tompscanlan merged 3 commits into
mainfrom
fix/attendee-idor
May 28, 2026
Merged

fix(event): close attendee-management IDOR on delete/update routes#587
tompscanlan merged 3 commits into
mainfrom
fix/attendee-idor

Conversation

@tompscanlan

Copy link
Copy Markdown
Contributor

Summary

  • Re-enables @Permissions(ManageAttendees) decorator on PATCH and DELETE attendee routes (commented out since Tom/crmc #235, May 2025)
  • Routes attendee deletion through EventManagementService with event-scoping, preventing cross-event IDOR
  • Adds findEventAttendeeScopedToEvent() defense-in-depth: verifies attendee belongs to the target event before any mutation

Security

Any authenticated user could delete or mutate any attendee record by ID, regardless of event ownership or role. The permission guard was bypassed because the decorator was commented out.

Group admin compatibility

The PermissionsGuard multi-layer check is preserved: group admins with MANAGE_EVENTS still pass through for group-hosted events (the CRMC multi-admin pattern). A dedicated e2e test pins this.

Test plan

  • Unit tests pass (controller.spec.ts)
  • e2e regression suite (test/event-attendees/attendee-authorization.e2e-spec.ts) - 5 scenarios:
    • Forbid non-organizer from deleting another attendee (IDOR)
    • Forbid non-organizer from updating another attendee (IDOR)
    • Allow event owner to delete attendees (positive control)
    • Cross-event IDOR prevention
    • Group admin can manage attendees on group events they didn't create (CRMC scenario)

Closes om-ct4o

The DELETE/PATCH /events/:slug/attendees/:attendeeId routes had their
@permissions(ManageAttendees) decorator commented out (since #235, May
2025), so PermissionsGuard fell through (no metadata => allow) and any
authenticated user could delete or mutate any attendee by id.

- Re-enable @permissions(ManageAttendees) on both routes
- Route delete through EventManagementService for event-scoping
- Add findEventAttendeeScopedToEvent() and verify the attendee belongs
  to :slug before update/delete (defense-in-depth vs cross-event IDOR)
- Add e2e regression spec (RED proven against live API)

WIP: GREEN e2e run still pending (running API serves main worktree).
Controller unit spec passes (30/30).
Adds a 5th scenario: a group admin who did NOT create the event can
still manage attendees on group events (the CRMC multi-admin pattern).
Ensures the IDOR fix doesn't regress group-level MANAGE_EVENTS grants.
Skip getGroupMembers call (403 in CI) and pass the joinGroup
membership ID directly to updateGroupMemberRole. Verified locally:
CRMC scenario passes, IDOR tests correctly fail against unfixed main.
@tompscanlan tompscanlan merged commit bd2577e into main May 28, 2026
4 checks passed
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.

1 participant