API Pen Testing

Testing REST and GraphQL APIs against the OWASP API Top 10

APIs carry the data behind every web and mobile app, and attackers call them directly. An API pen test maps every endpoint, then works through authentication, object- and function-level authorization, data exposure, resource limits and business flows, using the OWASP API Security Top 10 as the checklist.

Intermediate · 6 steps

ChecklistOWASP API Security Top 10 (2023)
InputsOpenAPI spec, Postman collection, proxied traffic
ToolsBurp Suite, Postman, OWASP ZAP
Most common findingAPI1 Broken Object Level Authorization
Also testOld versions (API9 Improper Inventory)
Accounts neededAt least two users per role

Step by step

  1. Map every endpoint Spec, collection and traffic

    The client provides an OpenAPI specification. The tester imports it into Burp and Postman, then also records the real traffic from the web and mobile apps. Comparing the two finds endpoints that aren't documented, including an old /v1/ version that is still reachable.

  2. Authentication API2 Broken Authentication

    The tester checks how tokens are handled: is the signature verified, is an expired token rejected, is the audience checked, are login and password reset rate-limited? Version 2 rejects an expired token, but version 1 still accepts it.

  3. Object and function authorization API1 BOLA and API5 BFLA

    With customer A's token, the tester requests customer B's order by ID (both test accounts): the API correctly returns 403. Then, still as a customer, they call an admin function, POST /v2/orders/{id}/refund, which should be admin-only. It succeeds: a function-level authorization flaw.

  4. Data in and out API3 Broken Object Property Level Authorization

    Responses are checked for fields the app never shows, and requests for fields a user shouldn't be able to set. The profile response includes another field, internalNotes, and sending "role":"admin" in a profile update is silently accepted (mass assignment). Inputs are also tested for injection, and GraphQL endpoints for open introspection.

  5. Limits and business flows API4 and API6

    Can one client ask for everything at once, or automate a sensitive flow? GET /v2/products?limit=100000 returns the whole catalogue in one call, and the "apply discount code" endpoint has no rate limit, so codes could be guessed by a script.

  6. Report against the API Top 10 Findings developers can act on

    Every finding is mapped to the OWASP API Security Top 10 category, with the exact request and response from Burp as evidence and a specific fix. The biggest fix is architectural: retire v1, and enforce role checks in one shared authorization layer.

Best practices

More in Penetration Testing.