Summary
A role-based access control (RBAC) implementation that trusts a client-side cookie as its sole authorization signal — no server-side verification, no signing, no session binding. Result: trivial vertical privilege escalation from a standard staff account to full administrator access.
This writeup documents the vulnerability found in Session Swap, a simulated internal staff portal ("Ridgeline Hotels"), and the exploitation path from low-privilege user to admin.
Target Behavior
Authenticating with standard staff credentials placed the session in a Front Desk Lead role. The dashboard exposed an Admin Console link, gated server-side:
HTTP 403 · admin.required A 403 response indicates the server is performing some authorization check — the objective was identifying where that check sources its data from.
Analysis
Inspecting the application's cookie jar via DevTools (Application → Storage → Cookies) revealed the authorization mechanism immediately:
| Name | Value |
|---|---|
role | user |
Plaintext, unsigned, client-writable. No HMAC, no JWT, no server-side session lookup — the application reads this value directly off the request and uses it to gate access.
Exploitation
Modifying the cookie's value client-side:
role: user → admin ...and reissuing the request to /admin was sufficient. No token refresh, no re-authentication, no additional checks. The server returned the full Admin Console: staff roster, audit logs, compliance reporting, and an internal memo containing the target flag (WEBVERSE{...}).
Root Cause
This maps directly to OWASP A01:2021 – Broken Access Control. Specifically:
- Authorization state is derived from client-controlled input (a cookie) rather than a server-side session or signed token.
- No re-validation of role occurs on the protected route; the server implicitly trusts whatever the client presents.
- There is no binding between the cookie's claimed role and the authenticated identity on the backend.
This is functionally equivalent to an IDOR/broken access control chain — the vulnerability isn't in guessing a value, it's in the server's unconditional trust of client-supplied state.
Remediation
- Eliminate client-authoritative authorization state. Roles/permissions must be resolved server-side from an authenticated session, never read from client-writable storage.
- Use signed, server-verified tokens (JWT with signature verification, or an opaque session ID resolved against a server-side store) if any session context is persisted client-side.
- Enforce authorization checks at the data/route layer on every request — treat every incoming request as untrusted regardless of what cookies accompany it.
- Audit and alert on anomalous role transitions, particularly ones that bypass a defined approval workflow.
Takeaway
Client-side storage — cookies, localStorage, anything the browser controls — should never be treated as an authorization source of truth. This class of vulnerability remains common in production systems and is a priority check in any access control review.
Challenge: Session Swap on WebVerse Labs
