Last updated: April 29, 2026
Authentication is the checkpoint at the door. Authorization is the checkpoint at every room inside the building. Most breaches happen because the door guard was fine but the room guards were distracted, missing, or following inconsistent rules. This module is about why auth checks fail so reliably in real-world systems — and how attackers exploit the pattern, not individual bugs.
Why this happens
Authentication is a design decision made early and globally. Authorization is a design decision made late, per-feature, by different developers at different times. Every new endpoint is a new authorization decision. Every refactor is a new opportunity to drop a check. Every microservice split is a new trust boundary where old assumptions don’t carry over.
Developers conceptualize security as “logged-in or not” — the binary check of authentication. They don’t conceptualize “this specific user for this specific resource at this specific moment” — the contextual check of authorization. Frameworks often help with the first and barely help with the second. The result: consistent auth, inconsistent authz.
How it happens
Five patterns account for nearly all auth-related breaches:
1. The “internal” endpoint assumption
Code comment: “This endpoint is only called by our frontend.” The URL is in the JavaScript bundle. The attacker reads the bundle, calls the endpoint directly, and the check that lives in the UI is never enforced server-side.
2. Object-level authorization gaps (BOLA / IDOR)
Endpoint verifies the user is authenticated. Doesn’t verify the user owns the object. GET /api/orders/{id} returns any order ID, not just the requester’s. Most pervasive auth bug in 2026.
3. Role inconsistency
Permissions checked in Service A. Service B doesn’t have the same check. Service A normally calls Service B with the user’s context. Attacker calls Service B directly and bypasses A’s check.
4. Header-based trust
Backend reads X-User-Id header. Assumes the load balancer or gateway set it. Attacker sends the header directly, through a misconfiguration or alternate path.
5. Session edge cases
User logs out → session invalidated, but the JWT issued 10 minutes earlier remains valid. Password change → old sessions remain active. Privilege downgrade → old session still has admin token.
Why we look
Because auth bugs are usually exploitable in minutes and give “I’m any user I want” access. In bug bounties, IDOR/BOLA is the highest-ROI class — fast to find, high severity. In red teams, a single auth gap makes “assumed breach” unnecessary: you start as any user you choose. Every auth review starts from “what does this service assume about who’s calling it?” and verifies each assumption.
What we find
- Endpoints that check
is_authenticated()but notcan_access(user, resource) - Route definitions where some routes have decorators and others don’t (inconsistency = someone forgot)
- Admin endpoints at predictable paths (
/admin/users) with no admin check beyond UI routing - Microservice calls where one service passes a user context header, trusted blindly by the next
- JWT verification that doesn’t check the audience, issuer, or subject claims
- Role checks in middleware that a specific route overrides
- Impersonation / “become another user” features that work for any user
- Password reset flows that reveal whether an account exists (user enumeration)
- OTP-based flows without per-user rate limits
- Token revocation that’s “best effort” — the backend trusts expiration alone
How to test
The systematic approach is the authorization matrix:
- Enumerate every endpoint (from the OpenAPI spec, or by proxying the full web + mobile app)
- Enumerate every role or user type (unauthenticated, standard user, tenant admin, super admin)
- For each endpoint × role, define what should happen (200 OK, 403 Forbidden, data scoped to user)
- Test every cell. A real-world matrix will fit in a spreadsheet; gaps jump out as “unexpected 200”
Tools: Burp Autorize replays requests as different users and flags differences. But the matrix approach finds gaps that Autorize can miss — specifically, endpoints that exist but aren’t in the documented surface.
The subtler variant: broken privilege separation
Sometimes authz checks exist but the privilege model is too coarse. Every admin can do everything. There’s no “read-only admin” or “finance-only” role. Compromise any admin account = compromise all admin capabilities. This is not a single bug; it’s an architectural debt. Pentest reports should name it explicitly so it becomes part of the roadmap.
Defence patterns that work
- Default-deny decorators on every endpoint (explicit allow for public ones)
- Object-level check baked into the data-access layer — if you can’t fetch it, you can’t see it
- Policy-as-code (OPA, Cedar) with uniform evaluation across services
- Impersonation flows that log to audit and always require target-user consent or elevated approval
- JWT with audience + issuer checks in every verifier, not just the primary one
- Session revocation on logout, password change, privilege change — require server-side invalidation
Mindset takeaway
Authentication is a single gate. Authorization is every gate after the first. When a developer says “this is safe because you have to be logged in” — you’ve found a bug hint. Test the state after login for every resource, every action, every role. The specific tools (Autorize, Burp, custom scripts) are secondary to the mindset: “the login is the floor, not the ceiling.” Every authorization decision is a fresh opportunity for the developer to forget, and an opportunity for the attacker to find.
Module Quiz · 15 questions
Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.
Custom team training + practitioner advisory
Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.