# Broken Access Control > The application authenticates the caller correctly but fails to enforce what that caller may do or see: OWASP A01 in both 2021 and 2025, and a logic flaw scanners can't see because the bug is a *missing* check, not a malformed input. ## How it works Access control depends on authentication (who you are) and session management (which requests are yours), but is a separate decision: is *this* principal allowed *this* action on *this* object in *this* state. PortSwigger splits the controls into three axes, and nearly every bug breaks one of them: | Axis | Restricts | Failure is called | |---|---|---| | Vertical | functions by user type (admin vs user) | vertical privilege escalation, [[Function Level Authorization]] failure | | Horizontal | resources by owner | [[Insecure Direct Object Reference]] / [[BOLA in APIs]] | | Context-dependent | actions by workflow state (no cart edits after payment) | multi-step / lifecycle bypass | Why it stays #1: - **OWASP 2025 data:** 100% of tested apps had some form of BAC; 40 CWEs mapped, max incidence 20.15%, avg 3.74%, 1,839,701 occurrences, 32,654 CVEs. The 2025 category absorbs CWE-918 (SSRF) and CWE-352 (CSRF) alongside CWE-862/863/639/200. - **Semantic gap:** SAST understands code structure but not business intent, so a missing ownership check is invisible to signature-based tools. Auth0 frames BAC/BOLA as "logical" versus "technical" (SQLi/XSS) vulnerabilities. - **Check sprawl:** authorization is imperative code repeated per route, resolver, worker and export. One missed `WHERE tenant_id = ?` leaks data, and AI coding agents repeat the omission at scale (see [[Multi-Tenant Isolation]]). ## Techniques / payloads Root-cause families, with the request shape that exposes each: | Pattern | Test | |---|---| | Unprotected functionality | browse `/admin`, `/administrator-panel-yb556`; URLs leak via `robots.txt` or role-gated JS shipped to everyone (`var isAdmin=false; if(isAdmin){...href='/administrator-panel-yb556'}`) | | Client-controlled role/entitlement | `?admin=true`, `?role=1`, hidden field, cookie `Admin=false`, body flag `unmaskContactData=true`, `roleid` in profile update | | UI-only enforcement | hidden button / `USER_SIGNUP:false` JS flag while `/signup` or `/auth/v1/signup` still works server-side | | Platform rule bypass | `X-Original-URL`, method swap, `/ADMIN/DELETEUSER`, `/admin/deleteUser.anything`, trailing slash; see [[Header-Based Access Control Bypass]] | | Multi-step gap | steps 1–2 checked, step 3 (confirm) not; replay step 3 directly | | Referer-based | sub-pages trust `Referer: https://site/admin` | | Leaky denial | 302 to login still carries the victim's data in the body | | Lifecycle / revocation | removed member still calls `GET /api/page/{pageId}/info` with a retained ID; soft-deleted invoice (`is_deleted=1`) still accepts `PUT /api/invoice/{id}/extracted-data` | | Unscoped search | wildcard/match-all term in a "find my records" API returns every account (USPS) ([[raw/medium.com/the-wildcard-parameter-that-exposed-60-million-usps-accounts-15889|USPS]]) | | Policy never called | detail/update route uses the policy; CSV export, search, included relations or a queued report job don't ([[raw/hcanovas.medium.com/laravel-authorization-the-data-leaks-your-policies-never-see-15928|Canovas]]) | | Object state ignored | hidden, comments-disabled, blocked-user and deleted states enforced in listings only, not on per-object read/comment/react endpoints ([[raw/community.protocall.ch/post-idor-hidden-posts-readable-by-id-listing-filter-bypass-15812|Protocall]]) | | Field-level leak | object check passes but a related field or notification carries data (ERPNext Document Follow) | Testing approach that finds these consistently: build a **permissions map** (roles × actions), then replay each privileged request with every lower-privileged session and with none (HackerOne's method; automated in [[Authorization Testing Automation]]). ## Notable cases - **ERPNext Document Follow (CVE-2026-66000/66058/66059)**: three stacked failures: any user could follow any document (object-level), update emails leaked fields (field-level), and notifications continued after permission revocation. - **"The User Was Removed. The Access Wasn't."**: an undocumented-in-UI endpoint from API docs returned private page metadata and member emails/permission levels to a user whose access had been revoked, because it only validated the JWT and the retained `pageId`. - **Munshi invoice API**: soft-deleted invoices remained writable, with no ownership, role, or `invoice_edit` permission check; server returned `200 OK` and persisted the change. - **B2B credit system (Wiz Red Agent)**: a single client-controlled boolean `unmaskContactData` let free-tier users unlock millions of paywalled contact records, a monetization control living in the client. - **Hiding a signup button**: frontend flag `USER_SIGNUP: false` but the signup endpoint stayed live, leading to cross-tenant data exposure. - **Zero-credential SaaS API**: unauthenticated access to premium features, user impersonation and private conversations via client-controlled metadata and exposed API docs. - **Kia (Sam Curry)**: registering as a dealer in the dealer portal minted tokens that controlled arbitrary vehicles from a license plate, a pure authorization failure on who may act on which VIN. - **USPS Informed Visibility (~60M accounts)**: no check that results belonged to the caller; Nicholas Weaver called it the absence of the most basic rule rather than a subtle lapse; fixed only after Krebs's 48-hour public pressure, over a year after the report ([[raw/medium.com/the-wildcard-parameter-that-exposed-60-million-usps-accounts-15889|writeup]]). - **Snapchat Spotlight**: GraphQL mutation deleted any user's Spotlight content, **$15,000**. - **$12,500 P1 from a "$0" IDOR**: impact came from chaining access-control oversights into workflow takeover and framing it as financial loss. ## Defenses OWASP Authorization Cheat Sheet, condensed: - **Deny by default**; require developers to declare allowed access per resource. - **Validate on every request**, server-side, in one application-wide mechanism (filter/middleware/decorator), not per-controller ad hoc `if` blocks. - **Prefer ABAC/ReBAC over RBAC** for object-level rules (see [[Access Control Models]]); externalize via PDP/PEP and policy-as-code ([[Authorization Policy Engines]]). - Lookup IDs must be safe **even when guessed**; randomized IDs are obscurity, not control. - Enforce authz on **static resources** and cloud storage too. - Handle lifecycle: revocation, deletion and role change must invalidate derived access (sessions, follows, share links, cached tokens). - **Exit safely** on failure (no data in the error/redirect body), log denials, and write unit/integration tests per role × endpoint. - Push tenant scoping into the data layer where possible (Postgres RLS; see [[Multi-Tenant Isolation]]). Express-specific anti-patterns Snyk calls out: unprotected `/admin` routes, `?isAdmin=true` gates, and obscured route names. ## Related - [[Authorization Security]] - [[Function Level Authorization]] - [[Privilege Escalation]] - [[Multi-Tenant Isolation]] - [[Header-Based Access Control Bypass]] - [[Insecure Direct Object Reference]] - [[BOLA in APIs]] - [[GraphQL Authorization Flaws]] - [[Mass Assignment]] - [[OWASP API Security Top 10]] - [[Authorization Testing Automation]] ## Sources - [[raw/owasp.org/owasp-top-10-2025-a01-broken-access-control-4691|OWASP Top 10 2025 — A01 Broken Access Control]] - [[raw/blog.qualys.com/what-changed-in-owasp-top-10-2025-full-breakdown-recommendations-9292|What Changed in OWASP Top 10 2025? Full Breakdown & Recommendations]] - [[raw/auth0.com/why-broken-access-control-dominates-owasp-top-10-in-2026-3693|Why Broken Access Control Dominates OWASP Top 10 in 2026]] - [[raw/portswigger.net/access-control-vulnerabilities-and-privilege-escalation-portswigger-2727|Access Control Vulnerabilities and Privilege Escalation - PortSwigger]] - [[raw/cheatsheetseries.owasp.org/authorization-cheat-sheet-owasp-3977|Authorization Cheat Sheet - OWASP]] - [[raw/cyberiumx.com/broken-access-control-vertical-privilege-escalation-writeup-2726|Broken Access Control - Vertical Privilege Escalation Writeup]] - [[raw/hackerone.com/how-to-find-broken-access-control-vulnerabilities-in-the-wild-hackeron-2736|How To Find Broken Access Control Vulnerabilities in the Wild - HackerOne]] - [[raw/snyk.io/preventing-broken-access-control-in-express-node-js-applications-9540|Preventing broken access control in express Node.js applications]] - [[raw/infosecwriteups.com/hiding-a-signup-button-isn-t-security-from-client-side-controls-to-cro-11866|Hiding a Signup Button Isn’t Security: From Client-Side Controls to Cross-Tenant Data Exposure]] - [[raw/medium.com/the-user-was-removed-the-access-wasn-t-12436|The User Was Removed. The Access Wasn’t.]] - [[raw/medium.com/soft-deleted-still-editable-bola-in-munshi-s-invoice-api-14942|Soft-Deleted, Still Editable: BOLA in Munshi’s Invoice API]] - [[raw/infosecwriteups.com/zero-credentials-full-access-inside-a-complete-authorization-failure-10535|Zero Credentials, Full Access: Inside a Complete Authorization Failure]] - [[raw/wiz.io/the-red-agent-pov-the-one-boolean-that-broke-a-b2b-platform-s-credit-s-10448|The Red Agent POV: The One Boolean That Broke a B2B Platform’s Credit System]] - [[raw/robinroy.xyz/erpnext-s-document-follow-feature-exposed-unauthorized-data-11315|ERPNext's Document Follow feature exposed unauthorized data]] - [[raw/dev.to/the-0-idor-that-was-worth-more-than-a-12-500-p1-business-logic-matters-14194|The $0 IDOR that was worth more than a $12,500 P1: business logic matters]] - [[raw/samcurry.net/hacking-kia-remotely-controlling-cars-with-just-a-license-plate-11440|Hacking Kia: Remotely Controlling Cars With Just a License Plate]] - [[raw/oxo.is/delete-anyone-s-snapchat-spotlight-content-remotely-15-000-idor-via-gr-13720|Delete anyone's Snapchat Spotlight content remotely ($15,000 IDOR via GraphQL mutation)]] - [[raw/community.protocall.ch/post-idor-hidden-posts-readable-by-id-listing-filter-bypass-15812|Post IDOR: hidden posts readable by ID, listing filter bypass]] - [[raw/medium.com/the-wildcard-parameter-that-exposed-60-million-usps-accounts-15889|The Wildcard Parameter That Exposed 60 Million USPS Accounts]] - [[raw/hcanovas.medium.com/laravel-authorization-the-data-leaks-your-policies-never-see-15928|Laravel Authorization: The Data Leaks Your Policies Never See]]