gateway: /api/teams endpoints unscoped — any authenticated user can enumerate all teams and member records #1428

Closed
opened 2026-08-26 22:15:57 +00:00 by fred · 0 comments
Collaborator

Found by the webUI audit (lane webui-audit, A3 finding F9.2; severity upgraded to MAJOR in P2 cross-review).

Measured: every route in apps/gateway/src/workspace/teams.controller.ts is behind AuthGuard only, with no membership scoping: GET /api/teams returns every team via TeamsService.findAll(); GET /api/teams/:teamId, :teamId/members, and :teamId/members/:userId answer for any team. Any authenticated user can enumerate all teams and their full member records.

No consumer breakage: grep across apps/packages/plugins finds zero callers of /api/teams outside the controller itself.

Fix (PR follows): scope list to the requester's memberships (admins keep findAll); per-team routes require admin or membership (404 missing / 403 no-access, same convention as the projects controller); membership self-lookup stays open.

Found by the webUI audit (lane webui-audit, A3 finding F9.2; severity upgraded to MAJOR in P2 cross-review). **Measured:** every route in `apps/gateway/src/workspace/teams.controller.ts` is behind AuthGuard only, with no membership scoping: `GET /api/teams` returns every team via `TeamsService.findAll()`; `GET /api/teams/:teamId`, `:teamId/members`, and `:teamId/members/:userId` answer for any team. Any authenticated user can enumerate all teams and their full member records. **No consumer breakage:** grep across apps/packages/plugins finds zero callers of `/api/teams` outside the controller itself. **Fix (PR follows):** scope list to the requester's memberships (admins keep findAll); per-team routes require admin or membership (404 missing / 403 no-access, same convention as the projects controller); membership self-lookup stays open.
fred closed this issue 2026-08-26 22:45:56 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1428