What good is a security scan that returns three hundred “low severity” warnings while a single broken endpoint quietly hands out every customer record in your database? That gap between passing a scan and actually being safe is where most API security programs fail. APIs now carry the bulk of business logic, and attackers know it. Testing them properly takes a different playbook than testing web pages, and the practices below are the ones that consistently find real problems instead of noise. (Best internet security australia)
Start With the Spec, Not the Scanner
Most teams point a scanner at a running API and hope for the best. The stronger move is to begin with the machine-readable contract. If the API uses OpenAPI, that document tells you every path, parameter, schema, and auth requirement before a single request is sent. Schema-driven testing lets you generate valid and invalid inputs systematically rather than guessing.
This matters because the OpenAPI Specification has evolved through versions 3.0, 3.1, and 3.2, and each version changes how schemas express required fields, nullability, and type unions. A test generator tuned for 3.0 will misread a 3.1 schema and produce garbage inputs. Check the spec version first, then pick tooling that supports it.
A practical workflow looks like this:
- Pull the current spec from source control, not from a stale wiki page.
- Diff it against the deployed version to find undocumented endpoints. Shadow APIs are a favorite target.
- Generate baseline requests for every operation, including error paths.
- Feed those into fuzzing and authorization tests.
Undocumented endpoints are the single most common finding in mature programs. If it responds but isn’t in the spec, nobody is testing it.
Treat Authorization as the Main Event

Broken object level authorization, often called BOLA or IDOR, has repeatedly ranked at or near the top of the OWASP API Security Top 10. The reason is simple: it is easy to introduce and hard to catch with generic scanners. A scanner sees a 200 response and moves on. It does not know that user A just read user B’s invoice.
Testing for it requires deliberate role-matrix work. Build a table of every role in the system and every object type, then attempt cross-role access on purpose.
| Test Case | Expected Result | What Failure Looks Like |
|---|---|---|
| User A requests User B’s record by ID | 403 or 404 | 200 with B’s data |
| Tenant 1 token queries Tenant 2 resource | Blocked at data layer | Data returned, filter applied only in UI |
| Read-only role sends a write request | 403 | 200, record changed |
| Deleted user’s old token replays a request | 401 | 200, action executed |
The critical mistake here is testing authorization only at the gateway. Gateways check whether a token is valid, not whether the token owner should see this specific row. Object-level checks must live in the data access layer, and your tests must prove they fire.
Authenticate Like an Attacker Would
Token handling is where confident teams get humbled. Test the full lifecycle rather than only the happy path. Expired tokens, tokens signed with a retired key, tokens from a deactivated account, tokens with the `alg` header swapped to `none`, refresh tokens reused after rotation. Each of these has a known failure mode and each deserves an explicit test case.
Two practices pay off repeatedly. First, test token revocation within the expected window, not eventually. If a password reset is supposed to kill active sessions, verify it in seconds, not after a cache expires. Second, test scope escalation. A token scoped to `read:orders` should fail on `write:orders`, and the failure should be a clean 403, not a 500 that leaks a stack trace.
For teams building identity infrastructure around machine credentials, the problem gets harder. Service accounts, workload identities, and API keys multiply faster than humans can track them, which is why comparisons like Astrix vs Oasis vs Entro non-human identity security 2026 are worth reading before choosing a control plane. Testing non-human identity paths deserves its own test suite.
Fuzz With Structure, Not Randomness
Dumb fuzzing finds crashes. Property-based and schema-aware fuzzing finds logic bugs. The difference is whether the tool understands that a field is an integer between 1 and 100 versus a free-text string.
RESTler, released by Microsoft Research with its first paper in 2019, pioneered stateful REST API fuzzing by inferring producer-consumer relationships between requests. Schemathesis takes a property-based approach driven by the spec. Both are open source and both are worth running in CI, but neither replaces human-designed tests for business logic.
What actually works in practice:
- Fuzz every field with boundary values, type confusion, and Unicode edge cases.
- Test sequence dependencies. Many bugs appear only when requests arrive out of order.
- Include malformed JSON, oversized payloads, and deeply nested objects to check parser limits.
- Run fuzzing on a schedule, not once per release, because new endpoints appear constantly.
The common mistake is treating a clean fuzz run as proof of safety. Fuzzing proves the absence of a narrow class of crashes. It says nothing about whether the discount code can be applied twice.
Map Tests to a Recognized Standard
Ad hoc testing produces ad hoc coverage. Anchoring your test plan to a published taxonomy makes coverage measurable and defensible to auditors. The OWASP API Security Top 10 is the standard starting point. The 2019 and 2023 editions differ in both categories and ordering, so cite the specific edition in your test documentation.
For deeper coverage, the OWASP Application Security Verification Standard (ASVS) works as a requirements checklist you can convert directly into test cases. Version 4.0.x served as the reference for years, with a 5.0 release arriving around 2025, so confirm the current version before you build your matrix around it. The OWASP Web Security Testing Guide includes an API testing chapter and remains a solid procedural reference.
For microservice architectures, the NIST SP 800-204 series covers security strategies for microservices-based application systems, published across 2019 to 2021. It is more architectural guidance than test procedure, but it helps justify controls to leadership. Avoid leaning on NIST SP 800-95, the 2007 guide to secure web services, as current API guidance; it is useful history and nothing more. (NIST Cybersecurity Framework)
If your APIs touch card data, PCI DSS v4.0, published in March 2022, brought future-dated requirements that became mandatory on March 31, 2025. Those requirements affect how you test and document payment API controls. Confirm scope details against the standard itself rather than secondhand summaries.
Put Security Tests in the Pipeline, Carefully
Continuous testing beats annual pen tests, but only if the tests are trustworthy. A pipeline that fails on every medium-severity finding gets muted within two weeks. The fix is tiering.
| Tier | Runs When | Blocks Merge | Focus |
|---|---|---|---|
| Fast checks | Every commit | Yes | Auth bypass, schema violations, secrets in code |
| Standard scan | Every pull request | Sometimes | OWASP API Top 10 categories |
| Deep fuzzing | Nightly | No | Stateful sequences, boundary values |
| Manual review | Per feature | No | Business logic, abuse cases |
The practical tip most teams learn the hard way: baseline your findings before enabling blocking. Run the suite in report-only mode for two weeks, fix the backlog, then turn on enforcement. Otherwise the first week of adoption is a wall of red that nobody trusts.
Secrets deserve a special mention. API keys committed to a repo are the most common and most preventable finding in the entire discipline. Scan for them at commit time, not at deploy time.
Build an Abuse Case Library
Functional tests ask “does it work?” Abuse cases ask “how would someone make it work for them?” This is where human testers still beat automation, and where most programs are thinnest.
Sit with the product team and write down the ways the API could be misused. Can a user enumerate other users by watching response timing? Can a coupon be stacked? Can a rate limit be bypassed by rotating a header? Can a pagination parameter pull the entire table in one request? Each answer becomes a test case that lives in the repo alongside functional tests.
Rate limiting and resource consumption belong here too. Test that limits apply per authenticated identity, not per IP, since attackers rotate addresses freely. Test that expensive queries have caps. A search endpoint that accepts unlimited wildcards is a denial-of-service waiting for a bored teenager.
Governance around these decisions matters as much as the tests themselves. Teams that document who owns which risk, and how exceptions get approved, tend to close findings faster. A framework for AI governance principles, risks, and best practices translates surprisingly well to API risk ownership, especially the parts about accountability and change review.
Measure Coverage, Not Finding Counts
The number of vulnerabilities reported is a terrible metric. It rewards noisy tools and punishes clean codebases. Better metrics: percentage of documented endpoints with at least one authorization test, median time from finding to fix, percentage of critical findings caught before production, and count of undocumented endpoints discovered per quarter.
Track the last one closely. A shrinking gap between spec and reality means your inventory is honest. An honest inventory is the precondition for every other practice on this list.
Conclusion
API security testing works when it is specific. Start from the spec so you know what exists. Attack authorization at the object level, because that is where real breaches happen. Fuzz with structure, map coverage to a recognized standard, and tier your pipeline so developers trust the results. Then add the piece automation cannot supply: a written library of abuse cases built with the people who know the product. Teams that do all five find real exploits. Teams that buy a scanner and call it done find out the hard way.
Frequently Asked Questions
How often should API security tests run?
Fast authorization and schema checks should run on every commit. Standard scans belong on every pull request. Deep fuzzing and stateful sequence testing work best nightly, because they take longer and produce findings that need human triage. Manual abuse-case review should happen once per feature, before release.
What is the difference between BOLA and broken authentication?
Broken authentication means the system fails to verify who you are, such as accepting a forged or expired token. BOLA means the system verified who you are but failed to check whether you should access that specific object. BOLA is more common in practice because authentication is usually handled by a library while object-level checks must be written by hand for every endpoint.
Can automated scanners find business logic flaws?
Rarely. Scanners excel at known patterns like injection, missing headers, and schema violations. They cannot know that a discount code should apply only once per account or that an approval workflow should require two distinct approvers. Business logic flaws require human-designed abuse cases written with product knowledge.
Do I need a separate API security tool if I already scan the web app?
Usually yes. Traditional web scanners crawl HTML links. They struggle with APIs that have no links, require specific JSON bodies, and depend on request sequences. Spec-aware API testing tools read the OpenAPI document and generate meaningful requests, which generic crawlers cannot do.
How do I test APIs that have no documentation?
Treat the absence of a spec as the first finding. Then reconstruct one by observing traffic through a proxy, capturing real client requests, and mapping every responding endpoint. Prioritize testing the undocumented endpoints first, since they are the least likely to have received any review.
Is penetration testing still worth the money?
Yes, but scope it to what automation cannot reach: chained attacks, business logic abuse, and authorization gaps across complex role hierarchies. A pen test that repeats what your scanner already covers wastes budget. Give the testers your abuse case library and ask them to break it.


