Security: stop /getEventUsers leaking attendee PII#505
Merged
Conversation
POST /getEventUsers is public (no auth) and returned the full
userRowToApi() shape for every attendee — exposing email, phoneNumber,
dateOfBirth, and suspension internals to anyone who knows an event ID.
Add a display-only userRowToAttendee() mapper { id, firstName, lastName,
profileImage } and use it for the public attendee list. It also drops
`username` because in this app username currently holds the login email,
so exposing it would leak the email too (see the username/email
decoupling follow-up).
Coordinators still get emails + guest RSVPs via the gated
GET /events/:id/roster.
- backend: userRowToAttendee() in types.ts; /getEventUsers uses it
- frontend: attendee display falls back safely to 'Member' now that
username isn't returned (5 mapping sites in useApiData)
- tests: assert the public list has no email/username/phone/DOB
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying chinmaya-janata with
|
| Latest commit: |
94cd62d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bc4e4843.project-janatha.pages.dev |
| Branch Preview URL: | https://fix-geteventusers-pii-leak.project-janatha.pages.dev |
KishParikh13
added a commit
that referenced
this pull request
Jun 17, 2026
Resolves #514's intent without reversing the #505/#504 privacy model: - Public attendee COUNT (people_attending) now = account attendees + non-upgraded guest RSVPs, via a shared recomputeAttendeeCount() called from addEventAttendee/removeEventAttendee/upgradeGuestRsvps/createGuestRsvp. So "X going" stays accurate including guests — no PII, just a number. - /getEventUsers (the WHO list) is now gated: authMiddleware (401) + must be an attendee, the creator, or an admin (else 403). Still PII-free; the separate gated /events/:id/roster remains the emails+guests view. - Frontend useEventDetail: count comes from the event's peopleAttending (not the account-list length); a gated list no longer errors the screen; RSVP toggles the count optimistically. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 17, 2026
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.
Problem
POST /getEventUsersis public (no auth) and returned the fulluserRowToApi()object for every attendee — leaking email, phoneNumber, dateOfBirth, and suspension internals to anyone who knows (or enumerates) an event ID. It powers the attendee avatar list, which only needs name + photo.Fix
userRowToAttendee()→{ id, firstName, lastName, profileImage }, used for the public attendee list.username, because in this appusernamecurrently holds the login email — exposing it would leak the email anyway. (That username==email coupling is a separate, larger cleanup; this PR is safe regardless of it.)'Member'/ initials now thatusernameisn't in the public payload (no crash on missing field).GET /events/:id/roster(separate PR Coordinator attendee roster + CSV export on the event page #504).Test plan
npm run typecheck(backend + frontend) clean/getEventUserscontains only id/firstName/lastName/profileImageRelated
Surfaces the broader username == email data-model issue (login uses email, stored in
username, with a parallelemailcolumn) — flagged for a dedicated decision/migration.