API Security: Why Authorization Is Where It Breaks
APIs fail differently from web apps. How broken object-level authorization, excessive data exposure and missing rate limits happen, and what to do.

A mobile app shows you your own order history. The request behind it fetches order number 48812. Someone curious changes that number to 48811 and gets back a different customer's order: name, delivery address, phone number, items. Then they write a loop and walk through every number from 1 upward.
No injection. No stolen credentials. The attacker was properly logged in as themselves the whole time, and every request was well formed. The API verified who was asking and never checked whether the thing being asked for belonged to them.
This is the characteristic API vulnerability, and it explains why API security needed its own body of guidance rather than inheriting web application advice. Classic web vulnerabilities are mostly about how input is parsed and output is rendered. API vulnerabilities are mostly about authorization logic, which no scanner can infer and no firewall can see.
Why APIs fail differently
Three structural differences drive it.
The client is not a trust boundary. A traditional server-rendered page decided server-side what you could see. An API hands data to an application that renders it, and that application runs on someone else's device where it can be inspected and modified. Any check that exists only in the app does not exist.
Objects are addressed directly. REST-style APIs expose identifiers in request paths by design. That is good interface design and it means every endpoint handling an identifier needs an ownership check, in every method, every time.
There are many more endpoints than screens. A moderate application can have hundreds of endpoints across several versions, documented inconsistently, some written years ago by people who have left. Consistency of enforcement becomes the hard problem.
The OWASP API Security Top 10 for 2023 reflects this. Of its ten entries, four are authorization failures of different kinds: broken object level authorization, broken object property level authorization, broken function level authorization, and unrestricted access to sensitive business flows. That concentration is the finding, not a coincidence.
The authorization failures
Object level: asking for someone else's record
This is the opening example and the first entry in the Top 10. The fix is conceptually simple and operationally demanding: every request that references an object must verify that the authenticated caller is allowed that specific object, and the check must happen server-side on every path that reaches it.
What makes it demanding is coverage. One endpoint missing the check undoes the other ninety-nine. Patterns that help are enforcing the check in a shared layer rather than per handler, scoping database queries by the caller's identity so an unowned record cannot be returned even if a check is forgotten, and using identifiers that are not sequential so that enumeration is not trivial. That last one is defense in depth, not a fix: unguessable identifiers raise the cost of discovery and do nothing about an attacker who legitimately obtains one.
Property level: returning more than the screen shows
An endpoint returns the full user object because that was convenient, and the app displays three fields. The other twenty are still in the response. OWASP's 2023 edition covers this as broken object property level authorization, which merges what earlier editions called excessive data exposure and mass assignment.
The reverse direction is the mass assignment half and is often worse. If an endpoint accepts a JSON object and updates whatever fields it contains, a request that includes a field the interface never offers may still be applied. Adding a role or account-status field to an otherwise ordinary profile update has been a real privilege escalation route in real systems.
The reliable pattern is explicit in both directions: define what each endpoint returns and what it accepts, field by field, and ignore anything else. Serializing whole database models directly is where this goes wrong.
Function level: calling the endpoint you were not shown
Administrative functionality is hidden from ordinary users in the interface and remains reachable if you know the path. Hiding a button is not an access control. Each privileged endpoint needs its own role check, and the test is to call it as an ordinary user and confirm the refusal.
Business flow level: abusing a feature that works correctly
The subtlest category. An endpoint that works exactly as designed can still be abused when used at machine speed: buying limited stock in bulk, reserving appointments to resell, sending invitations as spam, or scraping a catalog to undercut prices. Nothing is broken. The business assumption that a human does this a few times is what fails. Protecting against it means thinking about intent and rate rather than permissions.
Authentication: the other half
Broken authentication is the second Top 10 entry, and API authentication goes wrong in characteristic ways.
The most common is confusing identification with authentication. An API key in a mobile app or a browser is extractable within minutes, so it identifies which application is calling and proves nothing about who is calling. Keys are reasonable for server-to-server calls where the secret can actually be kept.
Token handling is the next cluster. Access tokens that never expire turn any single leak into permanent access. Tokens stored where other scripts on the page can read them are available to anyone who achieves script execution. Tokens accepted without verifying their signature and issuer have produced complete authentication bypasses. RFC 9700, the current best practice document for OAuth 2.0 security, is the right reference for getting these decisions right rather than inferring them from tutorials, and it reflects a decade of accumulated mistakes.
Two more worth naming. Authentication endpoints without rate limiting are an invitation to credential stuffing with passwords from previous breaches. And password reset or token refresh flows are frequently less protected than login while granting the same access, which is where attackers look once the front door is solid.
Rate limiting is a security control
Unrestricted resource consumption is in the Top 10 because limits are what contain the blast radius of everything else.
Consider the opening example again. With an authorization flaw and no rate limit, an attacker reads the entire customer database in an afternoon. With the same flaw and a sensible limit, they read a few hundred records and trip an alert. The flaw is identical; the outcome is not.
Limits also protect availability and cost. Expensive endpoints such as search, report generation, file conversion and anything calling a paid third-party service can be used to exhaust capacity or run up a bill, which is sometimes the actual objective. Our guide to DDoS attacks covers the application-layer version of this.
Practical limiting has a few requirements worth stating. Apply limits per authenticated identity, not only per address, since addresses are cheap and shared. Set different limits for different endpoint costs rather than one global number. Cap response sizes and pagination so a single request cannot ask for everything. Enforce at the gateway and in the application, because gateway rules get bypassed by internal routes. And return a clear status so legitimate clients can back off instead of retrying harder.
Inventory: the problem behind the other problems
Improper inventory management sounds administrative and is the reason the other nine persist. You cannot secure endpoints you do not know exist, and most organizations have more than they think.
The usual sources are version two shipping while version one stays live for a client nobody tracked, staging and test deployments reachable from the internet, endpoints built for a partner integration that ended, documentation generated once and never regenerated, and internal endpoints exposed externally by a gateway change nobody reviewed for security.
These shadow endpoints are the dangerous ones precisely because they are unmonitored. They run older code, they are missing the authorization fix applied everywhere else, and nobody notices unusual traffic to them.
What helps: maintain a list generated from running infrastructure rather than from documentation, so it reflects reality; run external discovery against your own domains to see what the internet can reach; give every API version a defined retirement date at launch; and route everything through a gateway so that an endpoint without one is visibly anomalous. The same discipline applies to the APIs you consume, which the Top 10 covers as unsafe consumption of APIs: data from a third-party API deserves the same validation as data from a user, because their compromise becomes your input. Our supply chain security guide covers that dependency more broadly.
The rest of the list, briefly
Security misconfiguration covers the familiar ground: debug endpoints left enabled, verbose errors returning stack traces, overly permissive cross-origin settings, missing transport encryption, default credentials on management interfaces. Server-side request forgery is specific to APIs that fetch a URL supplied by the caller, which can be turned inward to reach internal services and cloud metadata endpoints; the defense is validating and allowlisting destinations rather than filtering what looks internal.
For architecture, NIST's SP 800-204 covers security strategies for microservices-based systems, including the service-to-service authentication question that internal APIs usually answer with implicit network trust. The zero trust guide covers why that answer fails.
Testing that actually finds API flaws
Scanners are useful for misconfiguration, outdated components and known vulnerable patterns. They are close to useless for authorization, because a tool cannot know which records should belong to which user.
The test that finds real problems is cheap: create two accounts, perform an action as the first, then replay the request as the second with the first account's identifiers. Do it for every endpoint that handles an identifier. Do it for every method, since a missing check on delete is as serious as one on read. Then do the same with an unauthenticated session, and with a low-privilege account against administrative endpoints.
This can be automated into your test suite as a permanent assertion, which is the version that keeps working after the person who thought of it moves on. Combine it with the vulnerability management process for the dependency and configuration findings, which is where scanners earn their place.
Two accounts and ten minutes beats most automated scans. Deliberately requesting another account's records is the fastest authorization test there is, and it is worth repeating after every change to an endpoint that takes an identifier. For suspicious links and messages aimed at your developers, CyberWatch AI Scan gives a free check.
What to take away
The OWASP API Security Top 10 is one of the more useful lists in security because it is grounded in what goes wrong rather than what is theoretically possible, and its shape carries the lesson: authorization dominates. An API can use modern authentication, run on patched infrastructure, sit behind a gateway and still hand over every customer record because one endpoint checked that you were logged in and forgot to check whose data you asked for.
Enforce ownership server-side on every object, be explicit about every field you return and accept, limit how fast anyone can ask, and know what endpoints you are running. The rest is detail. For how APIs fit into the environment they usually run in, see the cloud security guide.
Frequently asked questions
Why do APIs need their own security guidance?
Because their failures are different. Classic web application attacks target how input is parsed and rendered. API attacks mostly target authorization logic: asking for a record that belongs to someone else, in a request that is otherwise perfectly well formed and properly authenticated.
What is broken object level authorization?
When an API checks that you are logged in but not that the specific record you asked for is yours. Changing an identifier in the request path from your own to someone else's returns their data. It is the first entry in the OWASP API Security Top 10 and the most common serious API flaw.
What is excessive data exposure?
When an API returns an entire internal object and relies on the client to display only the relevant parts. Anyone inspecting the raw response sees the hidden fields, which have included password hashes, internal notes, full addresses and tokens. OWASP's 2023 edition covers it as broken object property level authorization.
Is rate limiting a security control?
Yes. Without it, an authorization flaw that leaks one record becomes a flaw that leaks the whole database, and login endpoints become usable for credential stuffing. OWASP lists unrestricted resource consumption in its API Top 10 for this reason.
Should APIs use API keys or OAuth?
API keys identify an application and are reasonable for server-to-server calls where the key can be stored safely. OAuth with short-lived access tokens is the right model when a user delegates access to an application. Keys sent from browsers or mobile apps are not secrets and should not be treated as authentication.
What is a shadow API?
An endpoint that is live but not in anyone's inventory: an old version left running, a staging deployment reachable from the internet, or an internal endpoint exposed by a routing change. They are rarely monitored or patched, which is why OWASP treats improper inventory management as a Top 10 issue.
Does a web application firewall protect an API?
Partially. It can block known exploitation patterns and absorb some abuse, but it cannot tell whether the record you requested is yours, which is where most API vulnerabilities live. Authorization has to be enforced in the application.
Do internal APIs need the same controls?
Yes. Internal APIs that trust any caller on the network turn one compromised service into access to everything, and they are frequently exposed externally later by a routing or gateway change nobody reviewed.
How do we test API security?
Automated scanners find misconfiguration and known vulnerable components but miss authorization flaws, because a scanner does not know which records should belong to which user. Testing with two accounts and deliberately asking for the other account's data finds more real issues than any tool.
Sources
- OWASP API Security Top 10 2023, OWASP
- OWASP API Security Project, OWASP
- API1:2023 Broken Object Level Authorization, OWASP
- API3:2023 Broken Object Property Level Authorization, OWASP
- API4:2023 Unrestricted Resource Consumption, OWASP
- API9:2023 Improper Inventory Management, OWASP
- REST Security - OWASP Cheat Sheet Series, OWASP
- RFC 9700: Best Current Practice for OAuth 2.0 Security, RFC Editor
- SP 800-204, Security Strategies for Microservices-based Application Systems, US National Institute of Standards and Technology


