In September 2022, an attacker pulled the records of 9.5 million current and former Optus customers out of an API. According to the case Australia’s communications regulator later brought against the company, the vulnerable endpoint sat on a domain Optus no longer needed. A coding error had broken its access control in 2018. Optus found and fixed the same error on its main domain in 2021, but not on the forgotten one, which the regulator says was left “dormant and vulnerable to attack for two years.” Optus disputes parts of that account.
On the regulator’s account, none of that needed a clever exploit. It needed an endpoint nobody remembered, an access check nobody re-tested, and requests that looked like ordinary use. Those are the three gaps this guide covers: undocumented endpoints, broken authorization, and the abuse cases functional tests never try. Between them, they’re most of what API security testing is for.
Why Functional API Tests Miss Security Bugs
Functional API testing asks whether the API does what it should for the right caller. API security testing asks the opposite: what does it do for the wrong caller, in the wrong order, at the wrong volume, and on endpoints that aren’t in your test suite at all?
The OWASP API Security Top 10 (the 2023 edition, still the current one) gives those questions names. This guide’s three gaps map onto five of its ten risks:
| Gap | OWASP API Security Top 10 (2023) | What it looks like |
| Endpoints nobody remembered | API9 Improper Inventory Management | Old versions, debug routes and retired hosts that still answer |
| Broken authorization | API1 Broken Object Level Authorization · API3 Broken Object Property Level Authorization · API5 Broken Function Level Authorization | Another user’s record, a field you shouldn’t see or set, an admin action from a normal account |
| Abuse cases | API6 Unrestricted Access to Sensitive Business Flows · API4 Unrestricted Resource Consumption | Valid requests used at a volume or in a sequence nobody intended |
None of these produces an error in a functional run. The suite stays green because it only asks the questions the API was built to answer.
1. Find the Endpoints Nobody Remembered
Every API collects endpoints that outlive anyone’s memory of them: the /v1 that kept answering after /v2 shipped, a debug route added during an incident, an integration for a partner who left, a staging host loaded with production data. OWASP files these under improper inventory management. They’re dangerous for a simple reason: hardening and monitoring go to the endpoints people know about.
You can’t test what you can’t list, so API security testing starts with a diff of three lists:
- What’s documented: OpenAPI and GraphQL schemas, the gateway’s route table, the developer portal?
- What’s deployed: routes registered in code, load balancer and ingress rules, DNS records for API hosts?
- What’s actually called: gateway and access logs, and the traffic your web and mobile apps really generate?
Anything deployed or called but not documented is a finding. It needs an owner, a test, or removal. Then add the test most teams never write: a retired version should return 404 or 410, not 200. A deprecation notice in the docs means nothing if the route still answers.
ERP systems have their own version of this. Business Central’s Web Services page lists every page and code-unit published as a web service. Check it for objects published for integrations that no longer exist: each one is still an endpoint, answering with whatever permissions its integration account was given.
Scanners share the blind spot. Dynamic application security testing only covers the endpoints it’s told about, so seed scans from the deployed inventory, not just the spec.
2. Test Authorization by Ownership, Not Just by Role
Broken authorization holds three of OWASP’s top five API risks because it’s the bug happy-path tests are structurally unable to see. A functional suite runs as one well-behaved user requesting their own data. It never asks for anyone else’s. There are three kinds to test, and each needs a different design:
- Object level (BOLA, API1). Two users share a role, and one requests the other’s invoice by changing an ID. A role-by-endpoint matrix won’t catch this, because the role is allowed to call the endpoint. What it isn’t allowed to do is read that particular object. Test by ownership: create two users per role, swap their object IDs and tokens, and expect a 403 or 404 every time.
- Property level (BOPLA, API3). The response carries fields the UI never shows, such as another customer’s email or an internal cost, or an update accepts fields it shouldn’t, such as role, isAdmin or price. Check responses against an allowlist of fields, and send updates with extra properties to confirm they’re ignored.
- Function level (BFLA, API5). A normal user calls an admin operation directly, or switches GET to DELETE on a route they can read. Call every privileged operation with every lower-privileged token.
Add an unauthenticated caller for everything and, if the API is multi-tenant, a caller from another tenant. The point is more identities, not just more tests. Our post on AI agents for API testing explains how agents cover the role-by-endpoint matrix in both directions; ownership swaps are the half most suites still lack.
Contract tests can carry part of the property-level load. A response schema that rejects unexpected fields turns accidental data exposure into a failing build, as our guide to API contract testing explains.
A role matrix tests what a clerk can do. Broken object level authorization is about which clerk.
3. Write the Abuse Cases Your Functional Tests Skip
The hardest API attacks to catch use the API exactly as designed. In January 2024, someone fed email addresses from earlier breaches into a Trello API that returned the public profile linked to each address, and compiled about 15 million records. Atlassian said no unauthorized access was involved, and Trello then required authentication for those lookups. In May 2024, Dell disclosed a breach of a portal holding customer purchase records. The attacker claimed to have registered fake partner accounts and pulled 49 million records at around 5,000 requests a minute for three weeks.
Every request in both cases was valid on its own. Functional tests check one request at a time, so they can’t see the problem. Abuse is about sequence and volume, so write it as tests:
- Enumeration: can a caller walk sequential IDs, or tell an existing account from a missing one by the response?
- Volume: does the API return 429 after a sensible number of requests per token, per account and per IP?
- Step-skipping: can a caller jump straight to the last call in a flow, such as confirming an order that was never priced?
- Replays and races: does one coupon, refund or approval work twice when two requests arrive together?
- Tampering: negative quantities, zero prices, a currency switched mid-flow.
Assert outcomes, not just status codes. A 200 on a duplicate refund could be harmless idempotency or money paid out twice, and only the balance tells you which.
Making API Security Testing a Routine
None of this needs a separate team. It needs four habits that run on every change:
- Diff the inventory on every deployment and test anything new or forgotten.
- Run a DAST scan seeded from the full inventory for injection, misconfiguration and exposed debug endpoints.
- Run the identity matrix: roles for function level, owner swaps for object level, field allow lists for property level.
- Run the abuse suite against a production-like environment with production rate limits switched on.
A yearly penetration test still earns its place for the creative chains no checklist predicts. It just shouldn’t be the first time anyone tries user B’s token on user A’s invoice.
Where Sofy comes in
Sofy approaches API security from the testing side. Its AI agents exercise the running API rather than trusting the spec, generating coverage across parameter combinations, error paths and the authorization matrix in both directions. Ownership swaps and abuse cases run as ordinary regression tests in the same suite, so they keep running after the security review ends.
Around the API, Sofy’s security testing agents bring application security testing to your web and mobile apps: they analyze network traffic, APIs and headers against OWASP Top 10 classes, continuously rather than quarterly, and attach a remediation guide to each finding. Because they work from real traffic, they also show which endpoints your apps actually call, one side of the inventory diff.
What Sofy doesn’t replace: your gateway’s inventory, rate limiting at the edge, or a human penetration test.
Frequently Asked Questions
What is API security testing?
API security testing checks how an API behaves for callers and requests it wasn’t designed for: other users’ data, privileged functions, abusive volumes and forgotten endpoints. It complements functional API testing, which checks that the API works for the right caller.
What is BOLA in API security?
Broken Object Level Authorization, API1 in the OWASP API Security Top 10, is when a user can reach another user’s object, usually by changing an ID in the request. Test it by swapping object IDs and tokens between users who share a role.
How do you find shadow or zombie APIs?
Compare three lists: what’s documented (specs, gateway routes), what’s deployed (code routes, ingress rules, DNS) and what’s called (logs and app traffic). Anything deployed or called but undocumented needs an owner, a test or removal.
Can DAST test APIs?
Yes, for injection, misconfiguration and exposed endpoints, if you give it an API definition or real traffic to work from. It can’t judge who should own an object or what a business flow allows, so authorization and abuse cases still need purpose-built tests.
The Bottom Line
API breaches rarely need genius. They need an endpoint someone forgot, a check nobody re-ran after a change, or a feature used a few million times more than anyone intended. API security testing is the discipline of asking those questions on purpose: list what’s really deployed, test as the wrong user, and write the abuse cases before someone else runs them.
See Sofy’s Security Testing Agents
Move beyond manual testing with AI-powered agents designed to help teams automate security validation and improve testing coverage.

