Admin Endpoint Role Guard
Probe every administrative operation with a non-admin account and confirm the refusal is a 403 from the server, not missing UI
Use when: the product has staff, backoffice or platform-admin operations that normal members must never reach
Avoid when: you have no admin or member role pair available and cannot compare both sides of the guard
Procedure
- Enumerate administrative operations from clients, route tables and description documents, including staff-only paths.
- Send each operation with a plain member credential from your own second account and record the outcome.
- Confirm the guard covers every HTTP method, not only GET, since DELETE and POST frequently have separate handlers.
- Check for client-side-only protection by replaying requests taken straight from the admin UI without the UI in between.
- Look for data returned in error paths, where a failed check may still echo records before refusing.
- Record the enforcement point for each guarded endpoint so reviewers can rate the consistency of the design.
Signals
- A member credential receives complete admin data even though no admin link exists anywhere in the member UI.
- GET refuses with 403 while POST to the same path mutates state in some way the member should never trigger.
- An error response contains counts, names or identifiers that the refused list endpoint should never have touched.
- Admin behavior varies by prefix, so v2 routes guard properly while legacy v1 paths accept the member token.
Patterns
1. Method sweep
GET /api/staff/orders member -> 403
POST /api/staff/orders member -> 200 -> guard is per-method
2. Replay probe
copy admin UI request, swap session for member cookie -> record exactly what returns
3. Result row
path=/api/staff/* endpoints=12 guarded=GET-only=3 member=data-leak=1
Pitfalls
- Pretending the member UI proves security, when UI absence and server refusal are entirely different facts.
- Testing admin endpoints only with an admin account, which can only confirm the happy path.
- Ignoring tenant-admin versus platform-admin distinctions, the most common split that products under-model.
Done when
- Every administrative endpoint has a member-credential verdict recorded for every method it exposes.
- Client-side-only guards and data-echoing error paths, where found, are documented with reproduction requests.