On this page
APIs carry most of the data in a modern product. Your web front end, your mobile apps and your partners all talk to them, and each of those clients can be bypassed: an attacker simply calls the API directly. That is why API penetration testing focuses less on the screens users see and more on one question, repeated for every endpoint: does the server check that this caller is allowed to do this, to this object, right now?
This checklist maps what a tester verifies to the OWASP API Security Top 10 (2023). Use it to prepare for a test, to review your own API, or to judge whether a pentest report actually covered the risks that matter.
Before testing: what to prepare
A good API test starts with a complete picture of the API. Gather:
- The specification. An OpenAPI/Swagger file, a Postman collection or a GraphQL schema. Without one, testers rebuild the map from traffic, which spends time that could go into testing.
- Every version and environment in scope. Old versions (
/v1/next to/v2/) and forgotten hosts are a classic source of findings. - Accounts for each role, in at least two tenants. Most serious API flaws are about one user reaching another user’s data, so testers need two of everything.
- Authentication details. How tokens are issued, how long they live and how they are revoked.
This is the grey-box setup, the usual fit for APIs. If you can share code as well, a white-box test goes deeper in the same time.
The checklist, mapped to the OWASP API Security Top 10
| OWASP risk | What the tester verifies | Typical fix |
|---|---|---|
| API1 Broken object level authorization | Every endpoint that takes an object ID checks the caller owns or may access that object | Per-object authorization check on the server, on every request |
| API2 Broken authentication | Token issuance, expiry, revocation, password reset and brute-force protection | Short-lived tokens, server-side revocation, rate-limited login and reset |
| API3 Broken object property level authorization | Responses return only fields the caller may see; requests can only set fields the caller may change | Explicit allow-lists for readable and writable fields |
| API4 Unrestricted resource consumption | Limits on request rate, page size, upload size and expensive operations | Rate limits, pagination caps, timeouts and quotas |
| API5 Broken function level authorization | Admin and internal functions refuse normal users | Role checks enforced centrally, deny by default |
| API6 Unrestricted access to sensitive business flows | Flows such as sign-up, purchase or voting resist automated abuse | Business-level limits, step verification, abuse monitoring |
| API7 Server-side request forgery | Features that fetch URLs cannot be pointed at internal systems | Allow-lists of destinations, block internal address ranges |
| API8 Security misconfiguration | CORS, error messages, HTTP methods, TLS and security headers | Hardened, consistent configuration across environments |
| API9 Improper inventory management | Old versions, debug endpoints and undocumented hosts are known and protected | A maintained inventory; retire old versions |
| API10 Unsafe consumption of APIs | Data from third-party APIs is validated before use | Treat partner data as untrusted input |
The sections below explain the checks that most often produce high-severity findings.
API1: object level authorization (BOLA)
This is the most common serious API flaw, and the easiest to explain to a board: one customer can read or change another customer’s records. The tester signs in as user A, collects the IDs of A’s objects, then repeats the same requests as user B. If B gets A’s data, the server is trusting the ID in the request instead of checking ownership.
What to verify:
- Every endpoint that takes an ID, including nested ones such as
/accounts/{id}/invoices/{invoiceId}. - Read, update and delete separately. Teams often protect reads but forget deletes.
- IDs in the body, query string and headers, not only in the path.
- Random-looking IDs (UUIDs) help, but they are not an access control. The check must still happen.
Fix: look up the object and compare its owner or tenant with the caller on every request, in one shared layer rather than in each handler.
API2: authentication
Testers review the full token lifecycle:
- Are tokens signed and is the signature actually verified on every request?
- Do access tokens expire, and are refresh tokens bound to a user and revocable?
- Does logout or a password change invalidate existing sessions?
- Are login, OTP and password-reset endpoints rate limited?
- Are API keys kept out of URLs, logs and client-side code?
Fix: use a well-tested library for token handling, keep access tokens short-lived and enforce revocation on the server.
API3: property level authorization
Two flaws live here. Excessive data exposure is when a response includes fields the client never shows, such as another user’s email or an internal flag, trusting the front end to hide them. Mass assignment is when a request can set fields the user should not control, for example adding "role": "admin" to a profile update.
Fix: define response and request schemas explicitly and map only allowed fields. Never bind a request body straight onto a database model.
API4 and API6: limits and business flows
Rate limits protect both availability and money. Testers check pagination caps (?limit= values), upload sizes, expensive search or export operations, and flows that cost you something, such as sending SMS or emails. Business-flow abuse is about automation at scale: buying all limited stock, creating thousands of accounts or redeeming a coupon many times.
Fix: set limits per user and per IP for each sensitive operation, and add business rules (one coupon per account, purchase limits) on the server.
API5: function level authorization
Testers list every function, including admin and support endpoints found in the specification, in JavaScript bundles or by naming patterns, and call each one as the lowest-privileged role. They also try other HTTP methods on the same path: a route that blocks GET for normal users may still accept PUT.
Fix: deny by default and enforce role checks in one central place that every route passes through.
API7: server-side request forgery (SSRF)
Any feature that fetches a URL on the caller’s behalf, such as webhooks, link previews, file imports from a URL or PDF renderers, can be turned against you. Testers check whether that feature can be pointed at internal hosts, cloud metadata endpoints or other services that should never be reachable from the internet, including through redirects and alternative address formats.
Fix: allow-list the destinations the feature really needs, block private and link-local address ranges after DNS resolution, disable redirects where you can, and protect cloud metadata services (for example, require IMDSv2 on AWS).
API9: inventory management
You cannot protect an endpoint nobody remembers. Testers compare the specification with what the server actually answers: older versions still running next to new ones, debug or beta endpoints, and staging hosts that share production data. An old /v1/ route that skips a check added in /v2/ is a classic finding.
Fix: keep an up-to-date inventory of every host, version and environment, retire old versions on a schedule, and keep non-production APIs away from real data.
REST and GraphQL: what changes
Most of the checklist applies to both, but GraphQL needs extra attention:
- One endpoint, many operations. Authorization must be enforced in resolvers for every type and field, not at the HTTP route.
- Introspection. Useful in development; in production it hands out a full map of your API. Decide deliberately whether to allow it.
- Query cost. Deeply nested queries and batched operations can multiply the load of a single request. Apply depth and cost limits.
- Field-level exposure. It is easy to expose a sensitive field on a type that many queries can reach.
For REST, pay attention to versioning, consistent authorization across HTTP methods, and endpoints that exist in code but not in the documentation.
How to read an API pentest report
A strong report does more than list issues. For each finding you should see the endpoint and method, the roles involved, a proof of concept that reproduces it, a CVSS 3.1 score with its vector, and a fix your developers can act on. If you want to know what a complete report contains, see our guide to writing a penetration test report.
Also check coverage: the report should say which endpoints and roles were tested, so you can see what was not.
Test your API with WhyXpose
Our API penetration testing combines AI-guided scanning and AI triage across every endpoint with pentesters who work through this checklist by hand for every role you give us, in REST and GraphQL. Findings land in your dashboard as they are confirmed, with proof of concept, CVSS 3.1 and a fix, followed by a branded PDF report and a retest of what you fixed. If your API also serves a mobile app, consider testing both together with mobile app penetration testing.
Put this guide into practice
REST and GraphQL APIs tested by hand for every role, with proof of concept and CVSS 3.1 on every finding.
Explore API pentesting