Authorization Testing Automation
Mechanizing the one test that finds most access-control bugs: replay every request as every other principal (higher role, lower role, other tenant, anonymous) and diff the result. Done in the proxy while hunting, and in CI as regression tests.
How it works
Scanners can’t know the policy, but they can execute a matrix. The core artifact is an authorization matrix: features (endpoints/operations) × logical roles (OWASP adds a third dimension, data, for object ownership). Testing then means:
- Capture traffic as the highest-privileged principal (or as the object owner).
- Re-issue each request with a lower-privileged session, a peer in another tenant, and no session.
- Compare status, length and body markers. A “denied” that returns
200with the same body is a finding.
HackerOne’s “permissions mapping” (list roles, list actions, test every cell) and the “three-request” IDOR method are manual versions of the same loop. Snyk’s argument for why this matters more now: AI coding agents write endpoints that authenticate, handle not-found and read cleanly, but omit the org-scoping condition. The rule (“invoices belong to orgs; cross-org reads are never legit”) lives in the product, not the code, so pattern scanners have nothing to match.
Techniques / tools
In Burp (hunting):
| Tool | What it does | Notes |
|---|---|---|
| Autorize | shadows your browsing; re-sends each request with the attacker’s injected headers/cookies (low-priv) and optionally unauthenticated; flags red Bypassed! and orange Is enforced?? (uncertain, inspect manually) | configure enforcement detectors (body regex or length for “denied”) or you’ll drown in false positives; add interception filters scoped to the API host |
| AuthMatrix | define users, roles and requests explicitly, then run the full matrix | good for repeatable role × request grids on an engagement |
| Permitter | replays proxy history or site-map requests across configured roles via regex-based session-token substitution; optional unauthenticated pass | endpoint exclusion, delays, dedup, CSV/HTML export |
| Session Switcher (Doyensec) | saves named sessions and swaps cookies/headers in the request editor in one click; auto-refreshes from proxy traffic | for manual IDOR/privesc in Repeater |
| Burp authenticated scanning | recorded login replay, so the scanner reaches privileged areas | coverage, not authz decisions |
GraphQL: one object is often reachable through several resolvers (invoice(id:), node(id:) via Relay’s Global Object Identification (IDs are base64 Type:id), me { invoices }, nested edges). Enumerate every field that returns the target type from the introspection schema.json (or Clairvoyance if introspection is off), then as user B request user A’s object through every path in one aliased query. The spec isolates errors per alias, so the response shows exactly which resolver lacks the ownership check:
query {
control: invoice(id: "<B_INVOICE>") { id total }
viaInvoice: invoice(id: "<A_INVOICE>") { id total }
viaNode: node(id: "<A_NODE_ID>") { ... on Invoice { id total } }
}Autonomous agents: Wiz’s Red Agent found BOLA in an airline GraphQL booking API (predictable integer IDs, no backend check) and escalated to read/write over passengers’ PII and live itineraries. That is evidence that matrix-style probing automates well once sessions are supplied.
In CI (regression):
- OWASP Authorization Testing Automation: encode the matrix as XML (
<roles>ANONYMOUS/BASIC/ADMIN,<services>with URI, method and allowed roles,<services-testing>payloads). Integration tests iterate every combination and report the exact violating cell. - ExploitSpec: turns a confirmed BOLA/IDOR (from cURL/HAR, redacted) into a spec with isolated actors, captured dynamic values and the boundary to preserve. It must prove RED (vulnerable), then GREEN (fixed), then STABLE before it can fail the build; output as text, JSON or JUnit.
- Policy-as-code engines make the matrix testable directly; see Authorization Policy Engines.
Pitfalls
- Differential testing needs two of everything: two users per role and two tenants. A single account can’t show horizontal or cross-tenant failures.
- Detector tuning matters more than the tool. Redirect-to-login responses that still carry data,
200 {"error":"forbidden"}, and identical-length error pages all mislead naive diffing. - Writes and deletes need real objects owned by the other principal, with state checked afterwards. A
200doesn’t prove persistence.
Related
- Authorization Security
- Broken Access Control
- IDOR Testing Methodology
- BOLA in APIs
- GraphQL Authorization Flaws
- Burp Suite Extensions
- Multi-Tenant Isolation
Sources
- Automate your API hacking with Autorize · original
- Automating Authorization Testing: AuthMatrix Part 1 · original
- Permitter: Burp extension for multi-role authorization testing · original
- Introducing Session Switcher. Swap Burp Sessions with One Click! · original
- Improvements to Burp Suite authenticated scanning · original
- Authorization Testing Automation Cheat Sheet - OWASP · original
- ExploitSpec — BOLA/IDOR regression tests from bounded, redacted HAR input · original
- How To Find Broken Access Control Vulnerabilities in the Wild - HackerOne · original
- The Three-Request IDOR Method: How I Find Broken Access Control Before Breakfast · original
- GraphQL BOLA: one object, many paths, and how to prove the gap · original
- The Red Agent POV: Exploiting Broken Object-Level Authorization in an Airline GraphQL API · original
- Why AI Coding Agents Keep Writing Broken Access Control · original