0%
Security Engineering for Software Teams
Thinking About Security
Cryptography You Will Actually Use
Identity
Infrastructure and Cloud
Detection and Response
Broken Access Control and Tenancy Bugs
Broken access control is the most common serious weakness in web applications. It happens when a user can read or change data, or perform actions, that the application should not allow them to. Unlike injection or XSS, there is no special character or payload: the attacker sends a perfectly ordinary request, such as asking for invoice 1042 instead of invoice 1041, and the application answers because nothing checked whether that user may see it. This section describes what access control failures look like, why they are so common and how they differ from authentication problems.
Authentication versus authorization
Authentication answers who is making the request. Authorization answers whether that identity may perform this action on this resource. Many applications get authentication right, with strong login, sessions and tokens, and then fail at authorization, because it must be decided separately for every endpoint, every object and every field. A valid session tells the application who the user is, not what they may touch, and treating the first as the second is the root of most access control bugs.
Why it is so common
Access control logic is spread across the codebase rather than concentrated in one place. Each new endpoint, query, background job and export needs the right check, written by whoever builds the feature. Frameworks help with authentication, which is uniform, but cannot know the business rules for who may see what. Tests usually exercise the happy path for the correct user and rarely try the same request as a different user. The result is that checks are missed in a small share of places, and attackers only need one.
Vertical and horizontal escalation
Access control failures fall into two broad kinds. Vertical escalation means a user performs actions reserved for a higher role, such as a regular member calling an admin endpoint. Horizontal escalation means a user accesses resources belonging to another user at the same level, such as reading another customer orders. In multi tenant software there is a third dimension, crossing tenant boundaries, which is horizontal escalation with much larger consequences because one customer can reach another company data.
Insecure direct object references
When an application exposes an identifier, such as a numeric ID in a URL, and uses it to load a record without checking ownership, any user can change the identifier and load other records. This pattern is called an insecure direct object reference, or IDOR, and its API equivalent is broken object level authorization. It is the single largest category of access control findings in most programmes, because almost every API takes identifiers as input.
Missing function level checks
Some endpoints perform privileged operations, such as changing roles, issuing refunds or exporting all users. If the server checks only that the caller is logged in, any user who discovers the endpoint can call it. Hiding the button in the interface does not help, because the endpoint remains reachable. Admin APIs that share a codebase with user APIs, or that were added quickly for internal tools, are frequent sources of these bugs.
Trusting the client
Applications sometimes let the client decide authorization questions: a hidden field marking the user as an admin, a role in a cookie that is not signed, a price or discount sent from the browser or a flag in a JWT that the server does not verify. Anything the client sends can be changed. Authorization decisions must be made on the server from data the server controls, such as the authenticated identity and records in the database.
Forced browsing
Forced browsing means requesting pages or files that are not linked from the interface but are still accessible, such as admin pages, backup files, old API versions, debug endpoints or reports stored at predictable paths. Security through obscurity, relying on nobody guessing the URL, fails because URLs leak through browser history, logs, referrer headers, documentation and simple guessing. Every resource must be protected by a real check.
Mass assignment
Frameworks that bind request bodies directly to data models can let users set fields they should not, such as role, account balance, verified status or tenant identifier. A profile update endpoint that accepts the whole user object may let a user grant themselves admin rights by adding a role field. This failure, known as mass assignment, is an access control bug at the field level and is covered further in the fourth section.
Access control in non HTTP paths
Access control is not only for web endpoints. Background jobs that process user requests, message consumers, GraphQL resolvers, file exports, search indexes, analytics pipelines and support tools all read and write data on behalf of someone. A check in the HTTP handler is not inherited by a job that later runs with full database access. Every path that acts for a user needs to carry that user context and apply the same rules.
Impact
The impact of access control bugs ranges from minor disclosure to complete compromise. Reading another user address is a privacy breach. Changing another user email can enable account takeover. Calling an admin endpoint can expose every customer. In multi tenant products, a single cross tenant bug can expose many companies at once and trigger contractual and regulatory obligations. Because exploitation needs no special skill, these bugs are often found and abused quickly once known.
Detection difficulty
Access control abuse is hard to detect because each malicious request looks legitimate: a valid session, a well formed request and a normal response code. Unlike injection, there is no unusual payload for a firewall to match. Detection relies on patterns, such as one user accessing many sequential identifiers, many 403 or 404 responses or access to objects belonging to other tenants, which requires logging with enough context to tell whose data was accessed.
Deny by default
The most important design principle is deny by default: a request is refused unless a rule explicitly allows it. Frameworks and middleware that require every route to declare its access policy, and fail closed when none is declared, prevent the most common failure, which is simply forgetting to add a check. Allow by default systems depend on every developer remembering, and some will not.
Business logic flaws
Some access control failures are not about who owns a record but about how the product is supposed to work. A coupon applied twice, a trial extended by re registering, an order cancelled after shipment for a refund or a free plan user unlocking paid features by calling the API directly all break business rules rather than ownership rules. Scanners rarely find these, because the requests are valid. They are found by people who understand the intended behaviour and ask what happens when a user does the steps out of order, repeats them or skips them.
Where the rules come from
Authorization rules are product decisions: who can invite members, who can see billing, whether a guest can comment. When these decisions are never written down, each developer guesses, and different endpoints give different answers. Writing an explicit permission table for each feature, listing roles against actions, gives engineers something to implement and testers something to check against. It also exposes disagreements early, while they are cheap to resolve, instead of after a customer discovers that a viewer can delete projects.
Broken access control needs no payload, only a request for something the user should not have. It appears as missing object checks, missing function checks, trusted client decisions, forced browsing, mass assignment and paths outside HTTP handlers. Authenticate once, authorize every action and deny by default.