API security testing
Most products today are an API with a user interface attached. The interface enforces behaviour the API is often not enforcing itself: the button is hidden, the field is read-only, the role is not shown that menu. Every one of those decisions is a control that lives in the client, and the API is what an attacker talks to.
Testing concentrates on authorisation and business logic, because those are the classes that scanners cannot reach and that actually pay. Payload fuzzing is cheap to automate and rarely finds anything a mature team has not already fixed.
What gets tested
Object-level authorisation. Every endpoint that accepts an identifier is replayed with an identifier belonging to another user or tenant, using valid credentials for the attacker. Reads that return foreign data and writes that silently succeed are both findings; a consistent 404 across both is the correct result and is reported as such.
Function-level authorisation. Administrative or internal endpoints reached with an ordinary account, and endpoints that check the role for the UI route but not for the API call behind it.
Tenant resolution. Whether the tenant is derived from the authenticated session or from a field in the request. Any parameter naming an organisation, workspace, project or environment is a candidate.
Token handling. Lifetime and refresh rotation, signing algorithm handling, key identifier injection, claims the server trusts that the client can set, and tokens that outlive the permission change that should have revoked them.
Secret exposure. Keys and endpoints harvested from web bundles, mobile builds and error responses, then tested with a benign call to establish what they actually reach.
Enumeration and rate limits. Password reset, OTP, invite and lookup endpoints that confirm whether an account or object exists, and the limits that are meant to stop bulk use of them.
Mass assignment. Fields accepted by the server that the client can set but should not: role, tenant, approval state, price, limits.
Business logic. Price, quantity, currency, discount, state transitions, replay of one-time operations, and sequences that are individually valid and collectively wrong.
GraphQL specifics. Introspection exposure, depth and complexity limits, batching to bypass rate limits, and field-level authorisation that only exists on the top-level resolver.
Integrations. Webhook signature verification, SSRF through URL-accepting fields, and the trust assumptions between services.
Method
- Build the permission model before testing: roles, tenants, and what each is supposed to reach. Most authorisation bugs are only visible against that list.
- Prefer the API to the UI. Intercept one real request per feature, then replay directly for exact status codes and bodies.
- Run each cross-account test with a control: the legitimate request, then the substituted one, so a 403 can be attributed to the check and not to a malformed request.
- Prove every write by reading the object back from the owner's session, never from the write's own response.
Deliverables
A report per finding with the request pair, the accounts used, the root cause in the handler where it can be identified, and impact stated as what an attacker gains. Requests are shipped as a replayable script rather than screenshots, so the engineer can run the test themselves.
Common questions
What is broken object-level authorisation?
The failure to check, on every request that names a specific record, whether the caller may touch that record. The endpoint authenticates the user correctly, then acts on whatever identifier is supplied. It is the most common serious finding in API testing and no scanner reliably detects it, because proving it takes two accounts and a valid object belonging to the other one.
Does an API gateway or WAF prevent these issues?
No. An object-level flaw is a well-formed, correctly authenticated request that the application mishandles. The gateway sees a valid token and a normal payload. Authorisation has to be enforced in the handler that loads the object.
How many test accounts are needed?
At minimum two accounts in separate tenants, plus one low-privilege account inside a privileged tenant. Cross-tenant tests need both tenants to hold comparable objects, or the result proves nothing either way.
Related: AI and LLM security testing · Android application testing · how an assessment runs