Almost everything that goes seriously wrong in an API comes down to one question the code failed to ask: is this particular caller allowed to touch this particular thing? Injection and misconfiguration still appear. The findings that become real incidents, though, where a tester walks away with the whole customer table, tend to be authorisation failures, over-sharing, and endpoints that were never meant to be called by a stranger.
The OWASP API Security Top 10 is a good map of that terrain. This article is organised around it but written from the testing side of an API testing engagement. It covers the classes we spend most of our time on, roughly in the order they produce findings, and shows what each looks like on the wire. All examples below are generic illustrations and are not drawn from any client system.
The assumption underneath most of it
Web application security had a helpful accident: developers could see the attacker's tooling. A browser has a URL bar, view-source, and devtools, so it was always obvious that the client was under someone else's control.
APIs feel different, and that feeling is the root cause of much of this list. The caller is a machine, usually your mobile app or your SPA, so it is easy to reason as if the client were part of the trusted system. From there it follows naturally that the mobile app will only request the user's own records, that the admin button is hidden so the admin endpoint will not be called, that the frontend will not display fields it was told to hide, and that nobody will send a field the form does not contain.
Each of those assumptions is a security control running on the attacker's computer. When we test, we treat the documented client as one possible caller among many, and most findings follow directly from that change of view.
Broken object-level authorisation (BOLA)
This is the most common serious finding we see, and usually the most damaging. The API authenticates the caller correctly, then fetches the requested object by identifier without checking that the object belongs to the caller.
GET /api/v1/orders/78412 HTTP/1.1
Authorization: Bearer <token for user 5510>
HTTP/1.1 200 OK
{ "id": 78412, "customer_id": 9903, "email": "someone@example.com",
"shipping_address": "...", "total": 249.00 }
Order 78412 belongs to customer 9903; the token belongs to 5510. The authentication layer did its job (the token was valid), and then nothing asked the second question. In code it is usually a single missing clause:
// vulnerable: scoped only by the id the caller supplied
const order = await Order.findById(req.params.id);
// correct: scoped by the identity the server derived from the token
const order = await Order.findOne({
_id: req.params.id,
customerId: req.user.customerId, // never req.body / req.query / a header
});
Automation misses this because every response is a well-formed 200 OK, with
no error, stack trace, or other anomaly to flag. Whether the response is a
breach depends entirely on knowing who owns object 78412, which is a fact about
your data model. That is why
authorisation testing is a manual discipline:
the tester holds two accounts and systematically tries each one's identifiers
against the other's session.
A note on UUIDs: replacing sequential integers with UUIDs is worth doing, but it mitigates enumeration and leaves the authorisation gap open. Object identifiers leak constantly, in shared links, exports, webhooks, notification emails, and other API responses. Treat unguessability as friction and the ownership check as the actual control.
Broken function-level authorisation
This is the same failure one level up. The missing check is about which operation the caller may perform, rather than which object they may touch. Administrative or privileged endpoints are protected only by not being advertised.
Typical patterns we find:
- The UI hides an admin panel from non-admin users, but
POST /api/v1/admin/usersperforms no role check server-side. - Read is protected and write is not, because the guard was applied to
GETand forgotten onPUTandDELETE. - Route-level middleware protects
/api/v1/admin/*but a newer endpoint was registered under/api/v2/internal/outside the pattern.
DELETE /api/v1/admin/users/331 HTTP/1.1
Authorization: Bearer <token for an ordinary user>
HTTP/1.1 204 No Content
Two techniques reliably surface these: enumerating verbs against every discovered path, and reading the client bundle. A JavaScript bundle usually contains the full route table, including endpoints the current user's role never renders, so keeping an endpoint undocumented offers very little protection.
Excessive data exposure
Here the endpoint returns the entire database object and relies on the client
to render only part of it. Anyone with curl can read the rest.
GET /api/v1/users/5510/profile HTTP/1.1
HTTP/1.1 200 OK
{
"id": 5510,
"display_name": "A. Example",
"email": "a.example@example.com",
"phone": "+44...",
"password_reset_token": "9f2c1b...",
"internal_risk_score": 82,
"is_flagged_for_review": true,
"stripe_customer_id": "cus_..."
}
The profile page shows the display name and nothing else, yet every field below
it is sent to anyone who calls the endpoint. This usually comes from a generic
serializer, such as return jsonify(user.to_dict()) or an ORM object passed
straight into the response. It also gets worse over time, because every column
added later is published without anyone deciding to publish it.
The fix needs to be structural. Define explicit response schemas per endpoint and allow-list the fields, so new columns are private by default. Check nested and embedded objects as well, since that is where the discipline usually slips first: a carefully filtered order object often contains a fully populated customer.
Mass assignment
Mass assignment is the mirror image. The API accepts too much rather than returning too much, binding client-supplied JSON straight onto a model.
The registration form sends two fields. The tester sends four:
PATCH /api/v1/users/5510 HTTP/1.1
Content-Type: application/json
{ "display_name": "A. Example",
"email": "a.example@example.com",
"role": "admin",
"email_verified": true,
"account_balance": 100000 }
If the handler does user.update(req.body) and saves, privilege escalation
takes a single request. Field names are rarely secret. They appear in GET
responses for the same resource, in API documentation, in the client bundle,
and in error messages.
The defence is an explicit input allow-list per endpoint, enforced server-side. Deny-lists fail because whoever adds the next sensitive field to the model is unlikely to remember to add it to the list.
Missing rate limiting and enumeration
Rate limiting tends to be filed as an availability control, yet its absence often causes confidentiality failures. Without it, single-request weaknesses become bulk data extraction:
- A BOLA finding on
/api/v1/orders/{id}leaks one record if requests are limited, and the entire order history if they are not. - Credential stuffing against
/api/v1/auth/login. - One-time codes: a six-digit code with unlimited attempts offers little as a second factor. Rate limit and lock on the account as well as the source IP.
- Any endpoint that behaves differently for existing and non-existing values becomes a user enumeration oracle.
That last one deserves care, because the leak is often subtler than a different error message:
POST /api/v1/auth/reset HTTP/1.1
{ "email": "known@example.com" } → 200, response in ~410ms
POST /api/v1/auth/reset HTTP/1.1
{ "email": "unknown@example.com" } → 200, response in ~35ms
The status and body are identical, but the known address triggered a password hash computation and an email send, and the timing difference gives that away reliably. Responses meant to be indistinguishable need to match in status, body, and rough timing.
How these compare in practice
| Failure mode | How it is found | Typical blast radius | Automation catches it? |
| ----------------------- | -------------------------------------------------- | --------------------------------------- | --------------------------- |
| BOLA | Cross-account object access with two test accounts | Full dataset of all tenants | No, responses look valid |
| Function-level auth | Verb and route enumeration, client bundle review | Privileged actions, admin takeover | Rarely |
| Excessive data exposure | Reading raw responses rather than the UI | Secrets, tokens, internal fields | Partially, with tuned rules |
| Mass assignment | Adding fields observed in GET to PATCH/POST | Privilege escalation | No |
| No rate limiting | Repeat request timing and volume | Turns single leaks into bulk extraction | Sometimes |
| Enumeration | Differential status, body, or timing | Valid account lists for later attacks | Sometimes |
Look at the right-hand column. The classes with the largest blast radius are the ones automated scanning cannot resolve, because judging them requires knowing who is allowed to do what in your application.
GraphQL shifts these problems; it does not remove them
Teams sometimes assume a single typed schema tidies all of this up. In our experience it moves the work somewhere else.
What genuinely improves. Clients request specific fields, so accidental over-fetching of an entire object is less automatic, provided your resolvers do not fetch the whole record and filter afterwards. Strong typing also rejects some malformed input at the edge.
What gets harder.
- Authorisation must live in resolvers. There is one endpoint, so route-level middleware cannot express object-level rules. Every resolver returning sensitive data needs its own ownership check, and a field reachable through several query paths must be guarded on all of them.
- Nested traversal creates new paths to old data. A user may be forbidden from
querying
customer(id:)directly, yet reach the same object viaorder(id:) { customer { email } }because the nested resolver was written by someone who assumed the parent had already authorised it.
query {
order(id: "78412") {
id
customer {
id
email
phone
internalNotes
}
}
}
- Introspection publishes the attack surface. Where it is enabled in production, it hands over every type, field, and mutation, including the internal ones. That is convenient in development and an unnecessary gift in production.
- Query complexity replaces rate limiting. Counting requests means little when one deeply nested or aliased query can force enormous work server-side. Request throttling at the edge is not enough on its own; you also need depth limits, complexity scoring, and caps on aliased batching.
- Batching bypasses naive throttles. A single HTTP request containing many aliased mutations can retry a one-time code hundreds of times while your per-request counter increments once.
The lesson carries over from REST: put authorisation checks next to the data access, where they can see who owns what, instead of at the transport boundary.
Where this lands
If your API predates your current permissions model, has grown a v2 alongside a v1, or serves both a first-party app and external integrators, authorisation boundaries are the first place we would look. They are also the hardest part to gain confidence in without someone holding two accounts and systematically testing one against the other. If you are deciding whether your APIs warrant a dedicated test or fit inside a broader application engagement, we can work that out with you in a short scoping conversation.