Role-Based Access Control
Frontend-only RBAC can be bypassed trivially. Compare against server-validated token-based enforcement.
Select Role to Simulate
// In browser console:
window.__role = "admin"
// Access granted instantly
// Server decodes your JWT:
const role = verify(token, SECRET)
// Client cannot forge this
Test Actions
VulnerableRBAC restricts what actions a user can perform based on their role. A frontend-only check shows/hides UI buttons based on the role stored in JavaScript β but this is just cosmetic.
JavaScript runs in the browser. Anyone can open DevTools, change a variable from 'guest' to 'admin', and bypass any client-side check. The frontend is an untrusted environment.
Always enforce permissions on the server. Use a signed JWT β the server decodes the role from the token and checks permissions before executing any action. The client cannot forge a server-signed token.
Many early SPA applications put admin routes behind a simple JS check like if (user.role === 'admin'). Attackers bypassed this by editing localStorage or JS variables directly in the console.
Monitoring runtime activity⦠waiting for events
Stream will begin shortly