October 23, 2026
Learn what cloud security posture management (CSPM) is, how it works, key capabilities to demand, and a six-phase rollout plan for AWS, Azure, and GCP.

October 19, 2026
What is MCP security explained: the top risks, tool poisoning & prompt injection attacks, OAuth 2.1 authorization, pass/fail checklist to secure MCP servers.

October 15, 2026
Prompt injection, over-permissioned agents, leaked credentials: learn the top AI agent security risks and the controls that stop them before launch.
API security testing probes an API for weaknesses in authentication, authorization, input handling, data exposure, and rate limits before an attacker finds them. Run it before every major release, after any change to authentication or access rules, and on a recurring schedule for APIs that are already in production.
APIs deserve their own testing approach because they expose application logic and data directly, often with no interface in front to hide behind. OWASP's 2023 API Security Top 10 puts Broken Object Level Authorization first, a flaw where an API fails to check whether a user is allowed to access the specific record they request. A scanner built for web pages rarely catches it, because the request looks completely valid.
This guide covers what to test, how to follow the OWASP API Security Top 10, and how to build a checklist and CI/CD workflow your team can use right away.
API security testing involves sending crafted requests to an API to find flaws in how it authenticates callers, authorizes access, validates input, and limits the data and traffic it returns. It differs from functional API testing, which asks whether the API works, because it asks what the API allows that it shouldn't.
API security testing checks whether an API can be misused by someone with valid access, partial access, or no access at all. A tester acts as an attacker. They call endpoints with another user's ID, replay expired tokens, send unexpected fields, and push request volumes past normal limits. Each response shows whether the API enforced the rules it was supposed to enforce.
The testing covers the API's behavior, not just its code. An endpoint can be written cleanly and still return another customer's data because the authorization check was never added. That is why we test against a running API, with real tokens and realistic roles.
Web application testing focuses on pages, forms, and browser behavior. It looks for issues like cross-site scripting and insecure cookies, and it follows links the way a user would. APIs have no pages to crawl. A scanner can only test the endpoints it knows about, and it usually cannot tell whether a valid-looking response contains data the caller should never see.
API security testing fills that gap. It focuses on object-level and function-level authorization, token handling, mass assignment, excessive data in responses, and abuse of business flows such as repeated password resets or coupon redemption. OWASP maintains a separate API Security Top 10 alongside its web application list because API risks differ enough to need their own treatment.
Three traits set APIs apart. First, they expose object identifiers directly. A request like /orders/1042 hands the caller a key to guess, and any gap in the server's ownership check becomes a data leak. Second, much API traffic is machine to machine, so no human is present to notice odd behavior, and automated abuse can run for a long time at low volume. Third, APIs accumulate undocumented endpoints. Old versions, internal routes, and test endpoints often stay reachable after teams stop tracking them, and untested endpoints are where unpatched flaws tend to sit.
Together these traits mean that an API's real attack surface is usually larger than its documentation suggests. Testing therefore begins with discovering what is actually exposed, not with reading the spec.
The core questions stay the same across API styles. What changes is where the weaknesses tend to hide and what tooling a tester needs.
REST APIs use standard HTTP methods and resource paths, so testing centers on object identifiers, method handling (for example, whether a DELETE is allowed where only GET should be), and token scope. They are the easiest style to test with common tools.
SOAP APIs exchange XML messages described by a WSDL file. XML parsing introduces risks, including external entity injection and oversized or deeply nested payloads, and testers also check how WS-Security headers and message signatures are validated.
GraphQL APIs serve many queries through a single endpoint, so testing goes beyond individual URLs. Testers check whether introspection exposes the full schema in production, whether deeply nested queries can exhaust resources, and whether batching or aliasing lets an attacker bypass per-request rate limits.
gRPC APIs send binary Protocol Buffers over HTTP/2, which standard proxies cannot read without extra setup. Testers typically need the .proto definitions or server reflection to build valid requests, and they check authorization on each method individually, since there are no URL paths to rely on.

The OWASP API Security Top 10 (2023) is the standard checklist of the ten most critical API risks, and a solid API security test plan assigns at least one concrete test to each. Treat it as a coverage map rather than a compliance form: for every risk, decide which requests you will send and what response would count as a failure.
Each risk in the 2023 list points to a specific kind of test. The table below pairs them, using OWASP's exact risk names.
Risk | What to Test |
|---|---|
API1: Broken Object Level Authorization | Request objects belonging to another user by swapping IDs. |
API2: Broken Authentication | Replay, tamper with, and expire tokens; test login and password reset flows. |
API3: Broken Object Property Level Authorization | Inspect responses for excess fields and submit extra fields in requests. |
API4: Unrestricted Resource Consumption | Exceed rate, size, and pagination limits. |
API5: Broken Function Level Authorization | Call admin functions with low-privilege tokens. |
API6: Unrestricted Access to Sensitive Business Flows | Automate flows such as purchasing or signup and check for missing limits. |
API7: Server-Side Request Forgery (SSRF) | Supply internal addresses wherever the API fetches a URL. |
API8: Security Misconfiguration | Check headers, CORS, verbose errors, and default settings. |
API9: Improper Inventory Management | Look for old API versions, debug routes, and undocumented hosts. |
API10: Unsafe Consumption of APIs | Feed malicious or malformed data through integrated third-party responses. |
The 2023 edition merged two 2019 categories, Excessive Data Exposure and Mass Assignment, into API3 because both stem from the same root cause: missing property-level authorization. That shapes the test: read-side and write-side property checks belong in the same test case.

To test Broken Object Level Authorization (BOLA), authenticate as one user, capture a request that references one of their objects, then replay it with an identifier that belongs to a different user. If the API returns or modifies the other user's data, the endpoint is vulnerable.
You need at least two accounts with equivalent roles so you can separate "this user may not see that record" from "this role may not use that function." Repeat the test for every operation, not just reads: a GET may be protected while PUT and DELETE on the same path are not. Test every identifier location too, including path segments, query strings, JSON bodies, and headers, since developers often secure one and forget the others. Predictable sequential IDs make exploitation easier, but switching to random identifiers is not a fix. The authorization check is.
Broken authentication testing asks whether an attacker can pose as someone else. In contrast, broken function-level authorization testing asks whether a legitimate user can access functions meant for a different role.
For authentication, test how the API handles expired, unsigned, and modified tokens, whether credentials can be brute-forced without lockouts or throttling, and whether password reset and token refresh flows can be abused. For function level authorization, build a map of which roles should reach which endpoints, then call each privileged endpoint with every lower-privilege token. Administrative paths such as /admin or /users/export are obvious targets, but also try changing HTTP methods on ordinary endpoints, since a PATCH or DELETE is sometimes less protected than the GET beside it. A clear role matrix kept alongside the test plan makes these gaps far easier to spot.
These two risks cover abuse that requires no exploit. Unrestricted Resource Consumption means an API fails to limit how much work a caller can demand, which can cause outages or run up costs on metered services. Unrestricted Access to Sensitive Business Flows means a legitimate feature, such as buying tickets or posting comments, can be automated at harmful scale.
To test resource consumption, send requests at increasing volume, ask for very large page sizes, upload oversized payloads, and trigger operations that call paid services such as SMS or email. Look for the point where the API should have refused and did not. For business flows, identify the actions an attacker would want to repeat, then script them and see whether anything slows or stops the abuse. Because this risk often comes from design, not a code bug, a clean automated scan rarely reveals it. A tester who understands what the business would lose is what finds it.
Server-Side Request Forgery (SSRF) and Unsafe Consumption of APIs both involve the API's outbound trust. SSRF lets an attacker make your server fetch a URL of their choosing, while unsafe consumption means your API trusts data from a third-party service more than it should.
For SSRF, find every parameter that accepts a URL, such as webhooks, image imports, and document fetchers, and submit internal addresses, loopback ranges, and cloud metadata endpoints. A response, error message, or timing difference can show that the server tried to connect. For unsafe consumption, map the third-party APIs your service calls, then test how your code behaves when those responses contain unexpected fields, oversized values, malicious strings, or redirects. This is easy to skip because the traffic doesn't come from an end user, so it deserves an explicit line in the test plan.
The OWASP Web Security Testing Guide (WSTG) is the procedural companion to the Top 10: the Top 10 names the risks, and the WSTG describes how to test for them. It is a general web application guide, so use it for step-by-step technique and the API Security Top 10 for prioritization.
In practice, teams use the API Security Top 10 to decide what to cover, then draw on WSTG test procedures, including its guidance on testing GraphQL, to run the tests. Check the current WSTG chapter structure on owasp.org before linking to specific sections, since section numbering changes between versions.
A sound API security testing methodology moves through eight steps: inventory the API, set scope and test accounts, review the specification, test authentication, test authorization, test input handling, test abuse scenarios, then report and retest. Order matters because each step produces the information the next one needs.

Start by listing every API host, version, and endpoint that is actually reachable, not only the ones in the documentation. You cannot test what you do not know exists.
OWASP notes that APIs tend to expose more endpoints than traditional web applications, which is why it lists Improper Inventory Management among its top risks. Build the list from several sources: the OpenAPI file, API gateway configuration, DNS and certificate records, traffic logs, and client application code. Compare them. Endpoints that appear in logs but not in the documentation are shadow endpoints, and old versions still answering requests are deprecated. Both are common places for missing authentication and unpatched flaws, so flag them for priority testing.
Next, decide which environments, endpoints, and actions are in scope, and prepare the accounts and data the tests will use. Authorization testing is only as good as the roles you can simulate.
Create at least two users per role so you can test one user against another's data, plus an unauthenticated session and one account with administrative rights. Document what each role should be able to do, since you will compare results against that expectation later. Use a staging environment with realistic but non-production data whenever possible, and agree in advance on which destructive actions, such as deletions or bulk exports, are off limits. If third-party services sit behind the API, confirm whether testing them is permitted at all.
Review the API specification before sending traffic, looking for missing security definitions, overly permissive schemas, and differences between what is documented and what is deployed. A specification reveals design weaknesses quickly and costs little to check.
Look for endpoints with no security scheme attached, string fields with no length or format limits, objects that accept more properties than they need, and response schemas that return whole records instead of selected fields. Then check whether the live API matches the file. An endpoint that exists in production but not in the spec, or vice versa, indicates drift your inventory should track. Findings here often become test cases for the later steps.
Authentication testing checks whether the API correctly identifies who is calling and rejects anyone who cannot prove it. Begin with how credentials and tokens are issued, then try to break them.
Send requests with no token, an expired token, a tampered token, and a token signed with a different key or algorithm. Check that logout and password changes actually invalidate existing tokens, and that refresh tokens cannot be reused indefinitely. Test login, registration, and password reset endpoints for brute-force protection and for responses that reveal whether an account exists. Record how long tokens live and what they contain, since long lifetimes and sensitive data inside a token both raise the cost of a leak.
Authorization testing asks whether an authenticated caller can reach only the data and functions their role permits. It is where most serious API findings come from, so it deserves the most time.
Work through three layers using the accounts from Step 2. For object level, replay requests with another user's identifiers. For function level, call every privileged endpoint with each lower-privilege token. For property level, check whether responses expose fields a role should not see and whether requests can set fields a role should not change. Run each test across all HTTP methods on every path, not just the one the interface uses. Compare each result to the role matrix and log any deviation, even when it seems minor.
Input testing checks how the API behaves when requests contain unexpected data. The goal is to find places where unvalidated input reaches a database, interpreter, file system, or internal service.
Send injection payloads in every field the API accepts, including headers, query strings, and nested JSON values. Add extra properties to request bodies to test for mass assignment, such as a role or price field the client was never meant to set. Break the schema deliberately with wrong data types, oversized strings, empty values, deeply nested objects, and duplicate keys, then watch for server errors that expose stack traces or internal details. A request that the spec says is invalid but the server accepts is a finding on its own.
This step tests whether the API can be overwhelmed or exploited by using legitimate features in unintended ways. Automated scanners rarely cover it, so it relies on understanding how the business works.
Increase request volume against login, search, and data export endpoints to find where limits start, and confirm that limits apply per user or token and not only per IP address. Request very large page sizes and upload oversized files. Then pick the actions an attacker would want to repeat, such as redeeming a coupon, creating accounts, or booking inventory, and script them. If nothing slows the script down, the flow is unprotected. Also test sequences: skipping a step in a multi-step process, or repeating one, often exposes logic flaws that single requests do not.
The final step turns findings into fixes. A useful report lets a developer reproduce each issue and a manager understand its priority without a meeting.
For each finding, include the affected endpoint, the exact request and response, the role used, the risk it maps to in the OWASP API Security Top 10, a severity rating, and a specific remediation. Group related issues so teams fix root causes, such as a missing authorization layer, instead of patching one endpoint at a time. After fixes ship, retest every finding and a sample of nearby endpoints to confirm the fix works and did not shift the problem elsewhere. Feed the results back into the inventory and the next test cycle, so the process improves each time it runs.
This API security testing checklist covers the seven areas where API flaws most often appear: authentication, authorization, data exposure, input validation, rate limiting, logging and error handling, and configuration. Each item is phrased as a pass condition, so a tester can mark it pass or fail against a live API and record the evidence. The list aligns with the OWASP API Security Top 10 (2023), but it is a working checklist, not a replacement for the full standard.
The system rejects requests with no token, an expired token, or a malformed token with an authentication error.
Tokens with a modified payload or an invalid signature are rejected.
Tokens signed with an unexpected algorithm, including "none," are rejected.
Logout, password change, and account disable events invalidate existing tokens and sessions.
Refresh tokens expire, rotate, and cannot be reused after revocation.
Login, registration, and password reset endpoints enforce attempt limits and do not reveal whether an account exists.
Credentials and tokens never appear in URLs, logs, or error messages.
Access token lifetimes are short and match the sensitivity of the data they protect.
A user cannot read, change, or delete another user's objects by swapping identifiers in the path, query, body, or headers.
Every HTTP method on every endpoint enforces the same access rules, not just the method the interface uses.
Lower-privilege roles receive an authorization error on every administrative or privileged function.
Users cannot change their own role, permissions, or ownership through request fields.
Access rules are enforced on the server for every request, never inferred from client behavior or hidden interface elements.
Tokens are scoped to the minimum required permissions, and scope limits are enforced.
Results match a documented role matrix, and any deviation is logged as a finding.
Responses return only the fields the caller's role needs, not full database records.
Responses omit sensitive fields such as password hashes, internal IDs, tokens, and personal data when not required.
Requests cannot set or modify fields the caller should not control, including role, price, and status values.
List and search endpoints apply the same field and record restrictions as single-object endpoints.
Error responses and debug output do not expose data from other users.
Data returned from the API matches what the specification documents.
Every field has enforced limits for type, length, format, and range, and the API rejects out-of-range values.
Injection payloads in body, query, path, and header values do not alter server behavior.
Extra, unexpected properties in request bodies are rejected or ignored, not processed.
Wrong content types, empty bodies, and duplicate keys produce controlled errors.
Parameters that accept URLs cannot be pointed at internal addresses or cloud metadata endpoints.
File uploads are restricted by type, size, and content, and the stored files are not executable.
Requests that violate the specification are rejected by the live API, not just documented as invalid.
OWASP notes that some APIs rely on paid third-party services billed per request, so weak limits can cause outages and unexpected costs. Test limits with that financial angle in mind.
Limits apply per user or token, not only per IP address, and cannot be bypassed by changing headers.
Login, password reset, one-time code, and search endpoints have tighter limits than ordinary reads.
We enforce limits on maximum page size, payload size, query depth, and batch size.
Endpoints that trigger SMS, email, or other paid services are limited per account.
Requests that exceed limits receive a clear throttling response and the limit resets as documented.
The system detects or restricts repeated sensitive business actions, such as redeeming a coupon or creating accounts.
Log authentication failures, authorization denials, and rate-limit hits with the user, endpoint, and timestamp.
Logs do not store passwords, full tokens, or sensitive personal data.
Error messages are generic and do not reveal stack traces, file paths, database details, or software versions.
Every error returns a consistent format and appropriate status code, with no differences that reveal whether a record or account exists.
Suspicious patterns, such as many denied requests from one caller, can trigger an alert.
Logs are retained long enough to support investigation and protected from tampering.
All traffic uses current TLS versions, and plain HTTP is refused or redirected.
Security headers and cross-origin (CORS) rules are set explicitly and are not overly permissive.
Unused HTTP methods, debug routes, and sample endpoints are disabled in production.
Default credentials, keys, and configuration values are changed or removed.
Old API versions and undocumented hosts are retired or covered by the same protections as current ones.
API keys and secrets are stored outside source code and rotated on a schedule.
Third-party API responses are validated before your service trusts or stores them.
The inventory of hosts, versions, and endpoints is current, and any difference from the specification is investigated.
A good API security test case names the request you send, the response you expect from a secure API, and the response that would count as a failure. The five examples below use a fictional store API at api.example.com and describe what a tester does and what each outcome means. They are illustrative walkthroughs, not results from a real system.
This test checks whether the API verifies that a record belongs to the caller before returning it. It targets Broken Object Level Authorization, the first risk in the OWASP API Security Top 10 (2023).
class="wp-block-code" GET /api/v1/orders/1042
Authorization: Bearer User A tokenThen change only the identifier to an order that belongs to User B, keeping User A's token:
class="wp-block-code" GET /api/v1/orders/1043
Authorization: Bearer User A tokenA secure API returns 403 Forbidden or 404 Not Found and no order data. If it returns User B's order, the endpoint has a BOLA flaw. Repeat the test with PUT and DELETE on the same path, and try the identifier in query strings and request bodies too, because protection on one method or location does not guarantee the others.

This test checks whether the API truly validates a JSON Web Token's signature and expiry, instead of trusting whatever the token claims. Run it in two parts.
For expiry, capture a valid token, wait until it expires (or use a token from a test environment configured with a very short lifetime), and send it again:
class="wp-block-code" GET /api/v1/profile
Authorization: Bearer expired tokenA secure API returns 401 Unauthorized. To test tampering, decode the token's payload, change a claim (such as the user ID or role), and send the modified token without a valid signature. The API should reject it. Also try a token whose header sets the algorithm to none, since RFC 8725, the IETF's best-practices document for JSON Web Tokens, warns about libraries that accept unsigned tokens. Any 200 OK response to an expired, altered, or unsigned token is a failure.
This test checks whether the API accepts fields the client was never meant to control. OWASP's 2023 list folds mass assignment into API3, Broken Object Property Level Authorization.
Start with a normal profile update from a standard user:
class="wp-block-code" PUT /api/v1/users/me
{ "display_name": "Sam" }Then add fields that the interface never sends:
class="wp-block-code" PUT /api/v1/users/me
{ "display_name": "Sam", "role": "admin", "account_balance": 9999 }A secure API ignores or rejects the extra properties, and a follow-up GET /api/v1/users/me shows that the role and balance are unchanged. If either value changed, the API is binding client input directly onto internal objects. Check the response too: if it returns fields the user should not see, such as internal flags, that is the read-side version of the same flaw.
This test checks whether privileged functions are protected by role checks on the server, not just hidden from the interface. It targets Broken Function Level Authorization.
Using the role matrix from your test plan, pick an endpoint reserved for administrators and call it with a standard user's token:
class="wp-block-code" GET /api/v1/admin/users
Authorization: Bearer standard user tokenA secure API returns 403 Forbidden. A 200 OK with user data means the function is exposed. Then vary the request: try other methods on the same path (POST, PATCH, DELETE), look for administrative paths that follow a naming pattern, and try an ordinary endpoint with an added administrative parameter. A function that is correctly blocked on one method but open on another still counts as a failure.
This test checks whether the API slows or blocks repeated login attempts that would let an attacker guess passwords. It touches Unrestricted Resource Consumption and Broken Authentication.
Against a test account, send repeated failed login requests in quick succession:
class="wp-block-code" POST /api/v1/auth/login
{ "email": "[email protected]", "password": "wrong-password-1" }Increase the attempts until you see a control activate, such as 429 Too Many Requests, a temporary lockout, or an added challenge. Record how many attempts it took. A failure is an API that keeps accepting guesses indefinitely. Then check whether the limit can be sidestepped by changing a header that spoofs the client address, by rotating the account name, or by switching to a second login endpoint. Only run this on systems you are authorized to test, and use accounts created for the purpose so that real users are not locked out.
The security goals are the same for every API style, but testing changes with the protocol. REST testing centers on resources, HTTP methods, and token scope. SOAP testing centers on XML parsing and message-level security. GraphQL testing centers on the single endpoint and the flexibility of its query language. OWASP's Cheat Sheet Series publishes separate guidance for each, reflecting how they fail differently.
REST APIs expose resources through URLs and act on them with HTTP methods, so most REST-specific testing looks at how consistently the server enforces rules across paths, methods, and parameters.
Test every method on every resource, not just the ones a client uses. An endpoint that blocks DELETE on /orders/42 may still allow PUT, or the same action through a different path such as an older version. Try overriding the method with headers like X-HTTP-Method-Override, since some frameworks honor it even when the gateway does not expect it. Check that content types are enforced: send JSON to an endpoint expecting XML, or the reverse, and watch for parsers that behave unexpectedly. Test filtering, sorting, and pagination parameters for injection and for over-large values, because they are rarely validated as strictly as request bodies. Finally, confirm that tokens are scoped to the right resources, so a token issued for reading one collection cannot write to another. Because REST is stateless, every request must carry enough proof of identity and permission, which means each one needs its own authorization check.
SOAP APIs exchange XML messages defined by a WSDL file, so they inherit XML-processing risks and add message-level security features that need their own tests.
Start with XML parsing. Send documents that define external entities to test for XML External Entity (XXE) injection, where the parser reads local files or contacts internal systems. Try oversized payloads, deeply nested elements, and entity expansion attacks that exhaust memory. Then test the WS-Security layer, which provides signatures, encryption, and authentication inside the message itself. Remove or alter the security header, modify signed content, and replay captured messages to confirm that signature validation and replay protection actually work. Also check what the service publishes: a WSDL file that lists internal operations or is reachable without authentication gives attackers a complete map of the API. Test each operation listed in the WSDL individually, since authorization is often applied per operation, and one missed operation is enough for a finding.
GraphQL serves many different queries through a single endpoint, so security controls that depend on URLs, such as per-path rate limits, do not map cleanly onto it. Testing has to look inside the query itself.
Begin with introspection, the feature that lets clients ask the server to describe its entire schema. Send an introspection query to the production endpoint. If it responds, an attacker gets every type, field, and mutation without guessing, so confirm it is disabled or restricted where it should be, and check whether field suggestions in error messages leak schema details even when introspection is off. Next, test query depth and complexity: craft deeply nested queries, or queries that request large lists of related objects, and see whether the server limits the cost or runs until it times out. Then test batching and aliases. A single request can contain many operations, or the same field aliased dozens of times, which can bypass rate limits that count requests instead of operations. A login mutation repeated a hundred times in one request is a common example worth testing. Finally, test authorization at the field and resolver level, not just at the endpoint, because a user who may query one object type can sometimes reach restricted fields through a relationship from another.
Automated API security testing is best for broad, repeatable coverage of known weakness patterns. In contrast, manual testing is needed for context-dependent flaws, such as business logic errors and authorization failures that appear only when several steps are combined. Most mature programs use both: automation as the constant baseline, and human testers for depth before major releases and after significant changes.
Automated tools perform best when a flaw has a recognizable signature and can be confirmed from a single request and response. They also run the same checks every time, which makes them ideal for catching regressions.
Typical strengths include:
Common injection patterns in parameters and headers.
Missing or weak security headers and permissive CORS rules.
Outdated TLS configurations and verbose error messages.
Endpoints that accept requests with no authentication at all.
Schema violations, where the live API accepts input the OpenAPI specification forbids.
Known vulnerable components and exposed debug or default routes.
Automation is also the only practical way to run thousands of checks on every build. A scan that takes minutes in a CI/CD pipeline can catch a newly introduced misconfiguration the day it ships, long before a scheduled manual test would find it. For teams with dozens of services, that consistency matters as much as the depth of any single check.
Human testers are needed wherever finding the flaw requires understanding what the API is supposed to do. A tool can tell that a request succeeded, but it cannot tell whether it should have.
OWASP's description of Unrestricted Access to Sensitive Business Flows notes that this risk does not necessarily come from implementation bugs. The code can work exactly as written while still letting someone automate a purchase flow or abuse a referral program. No signature identifies that, so people must recognize which actions would harm the business if repeated at scale.
The same applies to authorization. A tool can swap an object ID and check the response, but it does not know which of your records belong to which tenant, or which role should see a particular field. Chained flaws are harder still: a low-severity information leak in one endpoint supplies an identifier that lets a tester reach an unprotected function in another. Spotting that chain requires reasoning across requests, which is where experienced testers add the most value. Multi-step workflows, where skipping or repeating a step breaks an assumption, fall into the same category.
Neither approach is complete, and each fails in predictable ways. Automated scans produce false positives that cost developer time, and false negatives that create false confidence. A clean report means the tool found nothing it knows how to find, not that the API is secure. Manual testing offers depth but is slower, harder to repeat, and dependent on the individual tester's skill, so coverage can vary between engagements.
Three blind spots deserve special attention:
Endpoints the tool never sees. Scanners test what they are pointed at. Shadow and deprecated endpoints are missed unless your inventory includes them.
Weak test setup. Without accounts for several roles and realistic data, automated authorization checks have nothing meaningful to compare, so they pass by default.
Authenticated-only coverage. Tools that cannot maintain a valid session or handle token refresh often test only the login page and report little else.
A practical split is to automate everything that can be checked in one request and enforce it in the pipeline, then reserve manual effort for authorization across roles, business flows, and any API handling money, personal data, or administrative functions. Feed what manual testers find back into automation as new regression tests, so each human finding strengthens the baseline.
DAST tests a running API from the outside, SAST analyzes source code without running it, IAST observes the application from the inside. In contrast, tests run the application, and fuzzing sends large volumes of malformed input to trigger failures. No single approach covers every API risk, so most teams combine two or three. OWASP's DevSecOps guidance for the 2023 API Security Top 10 says that scanning and penetration testing once a year are no longer enough, and recommends continuous security testing across the development life cycle without slowing delivery.
Approach | How It Works | What It Finds Well | When to Run It | Main Limitations |
|---|---|---|---|---|
DAST (Dynamic Testing) | Sends requests to a running API and inspects responses. | Injection, misconfiguration, missing authentication, exposed debug routes, and transport issues. | Against a deployed test or staging environment. | Tests only reachable endpoints; weak at authorization and business logic without role-aware setup. |
SAST (Static Testing) | Analyzes source code, configuration, or build artifacts without executing them. | Insecure coding patterns, hardcoded secrets, unsafe function use, and missing validation in code. | Early in development, on each commit or pull request. | Cannot see runtime behavior or deployed configuration; may produce many false positives. |
IAST (Interactive Testing) | Instruments the running application and monitors data flow while tests or traffic exercise it. | Vulnerabilities confirmed in context, including their code-level locations. | In test environments with an existing test suite or traffic. | Requires agent installation and language support; coverage depends on what the tests exercise. |
Fuzzing | Sends large volumes of unexpected, malformed, or random inputs. | Crashes, parser errors, unhandled exceptions, and input-validation gaps. | Against staging, often using schema-guided inputs from an OpenAPI file. | Can be noisy and time-consuming; finds robustness problems more readily than authorization flaws. |
The table shows why the approaches complement each other. SAST sees the code but not the deployment, DAST sees the deployment but not the code, and IAST bridges the two at the cost of instrumentation. Fuzzing covers an area the others handle poorly: how the API behaves when input is not what anyone planned for.
Open source and commercial tools in all four categories can find real vulnerabilities. The differences usually come down to effort and support, not whether a given flaw can be detected.
Open source tools tend to cost nothing to license, are transparent about how they work, and are easy to script into a pipeline. They often require more setup, such as configuring authentication, maintaining rules, and tuning results to reduce noise, and they rely on documentation and community support rather than a contract. Commercial tools often add guided configuration, role-aware scanning, reporting and ticketing integrations, dashboards for multiple teams, and vendor support. Their trade-offs are licensing cost, less visibility into detection logic, and sometimes slower adoption of new techniques.
Neither category fixes the underlying limits in the table above. A tool that cannot hold a valid session, or that was never given test accounts for several roles, will miss authorization problems regardless of price. Evaluate any tool on your own APIs, with your authentication flow and a few known flaws planted for it to find, instead of relying on feature lists.
Choose based on what you need to detect, where you can run it in the pipeline, and how much risk the API carries. Start with the cheapest approach that fits your pipeline, then add coverage where the risk is highest.
A reasonable starting point for most teams is SAST during development to catch coding flaws and secrets early, plus DAST against a staging deployment to catch runtime and configuration problems. Add schema-guided fuzzing for APIs that parse complex input, such as file uploads, XML, or deeply nested JSON. Consider IAST when you already have strong automated functional tests, since it uses their traffic to confirm findings. Whatever you choose, remember that none of these approaches reliably detects authorization and business logic flaws. Pair them with manual testing for APIs that handle payments, personal data, or administrative functions.
A few practical filters help narrow the choice:
Few engineers and little pipeline maturity: begin with DAST on staging and a spec-driven scan.
Many services and frequent releases: automate SAST and DAST in the pipeline and enforce thresholds.
High-risk or regulated data: add manual authorization testing and periodic external review on top of automation.
API security testing fits into a CI/CD pipeline by matching each test type to the earliest stage where it can run reliably: fast code and spec checks at commit, dependency and container checks at build, dynamic and authorization tests in staging, and deeper checks before release. The goal, as OWASP's DevSecOps guidance for its 2023 API Security Top 10 puts it, is to add security automation to the pipeline without reducing development speed.

Place each test where it gives the fastest useful feedback. A test that takes ten minutes does not belong on every commit, and a test that needs a running API cannot run before something is deployed.
At commit, run checks that finish in seconds and need no running service: secret scanning, static analysis of changed code, and linting of the OpenAPI specification for missing security schemes or unrestricted schemas. Developers see results while the change is still fresh.
At build, check what goes into the artifact: third-party dependencies with known vulnerabilities, container image and infrastructure configuration, and license or provenance issues. These checks apply to the whole package, not individual changes.
In staging, run tests that need a live API: automated dynamic scans, spec-driven request checks against the deployed service, and authorization tests that use accounts for several roles. This is where regressions in authentication and object-level access are most likely to be caught, so keep the test accounts and data stable.
Before release, run slower or deeper tests you wouldn't run on every change: extended fuzzing, rate-limit and abuse testing, and manual review of high-risk changes such as new authentication flows, payment endpoints, or administrative functions. Teams commonly run these on a schedule or for major releases instead of every build.
A gate should stop releases for serious, confirmed problems and let everything else through with a ticket. If every medium-severity finding blocks a deployment, developers will find ways around the check, and the pipeline loses its value.
Start by defining the findings that always block: confirmed authentication or authorization bypasses, exposed secrets, and critical vulnerabilities in internet-facing endpoints. Treat lower severities as warnings that create tracked issues with an owner and a due date. Introduce new checks in report-only mode first, review the results for a few cycles, and then enforce them so developers aren't surprised by a wall of failures. Give teams a documented exception process with an expiry date, since an unexplained permanent bypass quietly becomes the real policy.
Where findings appear matters as much as what blocks. OWASP advises delivering findings in the tools development teams already use, not in PDF reports, and explaining each weakness with a realistic attack scenario. In practice, that means failing builds with a clear message, opening tickets in the team's tracker, and linking each finding to the exact request and endpoint.
False positives and poor test data are the most common reasons pipeline security testing gets ignored. Both are manageable if you plan for them.
For false positives, review new findings quickly, mark confirmed false positives with a reason, and suppress them at the narrowest scope possible, such as one endpoint and one rule, not a whole category. Record each suppression in version control so you can review it later, and revisit it when the code changes. Tune scanner rules to your framework and authentication method, since default settings tend to be noisy.
For test data, use dedicated accounts and records that exist only for testing. Create at least two users per role so object-level authorization checks have something to compare, and reset the data between runs so results are repeatable. Never point automated tests at production data, and avoid storing real personal data in test fixtures. Store test credentials and tokens in the pipeline's secrets manager, not in the repository, and rotate them on a schedule. If a scanner cannot log in or refresh tokens, it will quietly test only unauthenticated paths and report little, so confirm that authenticated coverage actually works.
This example shows one reasonable layout for a team shipping a REST API. Adjust the tests to your stack, and treat the thresholds as starting points to tune.
StageTestsRunsBlocks release on
Stage | Security Checks | Frequency | Release Gate / Action |
|---|---|---|---|
Commit / Pull Request | Secret scanning, static analysis of changed code, and OpenAPI specification linting. | Every commit | Block exposed secrets and critical static analysis findings. |
Build | Dependency and container scanning, plus infrastructure configuration checks. | Every build | Block critical vulnerabilities in internet-facing components. |
Staging Deploy | Dynamic scanning, specification-driven request tests, and multi-role authorization tests. | Every staging deployment | Block confirmed authentication or authorization bypasses. |
Pre-Release | Extended fuzzing, rate-limit and abuse tests, and manual review of high-risk changes. | Scheduled or per major release | Block release for unresolved high-severity findings on new or changed endpoints. |
Production | Monitoring, API inventory comparison against the specification, and periodic retesting. | Continuous or scheduled | Generate tickets and alerts rather than acting as a release gate. |
The pattern is consistent: fast, narrow checks run often, and slow, broad checks run less often but cover more ground. Each stage feeds the next, so a finding caught at commit never reaches staging, and the staging tests can focus on behaviors that only a running API reveals.
API security testing finds weaknesses before an API ships, while runtime protection detects and blocks attacks once the API is live. Testing answers "what could be exploited?" and runtime protection answers "what is being attempted right now?" They overlap less than they appear to, which is why teams that rely on only one tend to have gaps the other would have covered.

Testing finds flaws in how an API is built and configured, when fixing them is cheapest. A tester controls requests, accounts, and timing, so results are repeatable and tied to specific endpoints.
This is where testers discover authorization gaps, injection flaws, mass assignment, weak token handling, and misconfiguration, and trace them to root causes. Testing can also target high-risk areas, such as a new payment flow, and include checks that would be unsafe or disruptive in production, such as aggressive fuzzing or abuse simulation. The result is a list of confirmed problems that developers can fix before customers are exposed.
The limit is scope and time. Testing covers the endpoints you know about, with the accounts and data you prepared, at the moment you ran it. OWASP's description of Improper Inventory Management notes that APIs often expose more endpoints than traditional web applications, including deprecated versions and debug endpoints. A test cannot examine an endpoint nobody listed, and it cannot predict how real attackers will behave next month.
Runtime monitoring and protection observe live traffic, so they catch what only appears under real conditions: actual attack attempts, unusual behavior by legitimate accounts, and endpoints that exist in production but were never documented.
Typical capabilities include detecting credential stuffing and scraping, spotting a single account suddenly requesting thousands of different object IDs, blocking known malicious payloads, enforcing rate limits, and discovering traffic to shadow or deprecated endpoints. Because they rely on observed behavior, they can flag abuse of business flows no test anticipated, and they provide the logs and alerts incident response depends on.
Runtime tools also have limits. They generally detect or block attacks without removing the underlying flaw, so an authorization bug stays in the code even if its exploitation is slowed. They depend on the quality of their rules and baselines, which can produce false alarms or miss low-and-slow abuse. And a request that looks entirely normal, such as a valid user retrieving another user's record, can be hard for a runtime layer to recognize as an attack without context about who owns which data.
Larger organizations and teams in regulated sectors tend to need both because the risks that testing and runtime protection each leave open are ones these teams cannot afford to carry. At scale, a few thousand endpoints change constantly across many teams, so a point-in-time test quickly goes out of date, while monitoring keeps watching what is actually deployed.
The two also answer different questions that auditors, regulators, and boards ask. Testing provides evidence that controls were verified before release, while runtime monitoring provides evidence that attacks are detected, logged, and handled. Many regulatory and audit frameworks expect both prevention and detection, so confirm the exact wording of the rules that apply to you instead of assuming either one suffices on its own.
They also have a practical dependency. Runtime data shows which endpoints and behaviors attackers actually target, which tells testers where to focus next. Testing results show which flaws a runtime control should be compensating for until a fix ships. Together, they make each other more accurate.
The simplest way to combine them is to treat them as two stages of one feedback loop, not as separate programs. Testing sits in the pipeline before release, runtime monitoring sits after deployment, and findings flow in both directions.
On the pipeline side, keep your automated and manual tests as described earlier, and add runtime tool specification or policy checks so new endpoints are registered before they go live. On the production side, send runtime alerts into the same ticketing and incident tools your developers already use, and tag each alert with the owning service so it reaches the right team. Use runtime discovery of undocumented endpoints to update the API inventory your tests are scoped from, and turn confirmed production attack patterns into new regression tests so you don't miss the same issue again.
For compliance, keep a single record that links test results, fixes, and runtime incidents to each API. That gives auditors one traceable story from verification to detection to response, and it saves your team from reassembling evidence separately for every review.
Regulated industries test APIs because the data they expose is protected by law, and most regimes set testing requirements for applications and systems in general, including APIs. A rule that names "penetration testing" or "application security testing" almost always covers your APIs if they handle regulated data. The sections below show how that plays out for payments, healthcare, crypto, and the main GCC and global frameworks.
For any organization that stores, processes, or transmits payment card data, PCI DSS v4.0.1 is the only active standard. Version 4.0 was retired on December 31, 2024, and the future-dated requirements became mandatory on March 31, 2025.
The standard does not have an "API testing" checkbox. The standard covers APIs through requirements for bespoke and custom software and public-facing web applications. Requirement 6.2.4 expects protections against common software attacks, and requirements 6.4.1 and 6.4.2 address public-facing web applications. Vendor summaries describe these as extending to APIs. Requirement 11.4 covers penetration testing, which secondary sources describe as required at least every 12 months and after significant changes, with application-layer testing included in the methodology. In practice, a payment API should be tested for the OWASP API Security Top 10 risks, prioritizing object-level and function-level authorization, since those flaws most directly expose cardholder and account data.
Healthcare APIs expose patient records, so the highest-risk flaw lets one user retrieve another patient's data by changing an identifier. That is the same Broken Object Level Authorization test described earlier in this guide.
Under the HIPAA Security Rule currently in force, penetration testing is not named as a standalone requirement. The rule requires a risk analysis covering potential risks and vulnerabilities, and testing is a common way to support it. In December 2024, HHS proposed updating the rule to require vulnerability scanning at least every six months and penetration testing at least every 12 months. Secondary sources reviewing the status in mid-2026 describe the proposal as not yet finalized, so treat it as a signal of regulatory direction, not a current obligation, and check the Federal Register before stating it as law.
Crypto platforms depend heavily on APIs for exchange trading, wallet operations, and customer onboarding, so API testing sits inside their regulatory obligations. Dubai's VARA is one clear regional example.
VARA's Technology and Information Rulebook requires virtual asset service providers to engage a qualified, independent third-party auditor to perform vulnerability assessments and penetration testing at least annually and before introducing any new systems, applications, or products. It also requires security testing of both infrastructure and applications, with evidence documented and available for inspection. Because trading and withdrawal APIs are applications, they fall within that scope. For the full set of requirements, see our VARA cybersecurity requirements checklist and use it instead of repeating those rules here.
Most regulators treat API testing as part of broader application security and penetration testing duties, with a few frameworks addressing APIs directly. The picture differs by authority.
NIST publishes the most API-specific guidance. NIST released NIST SP 800-228, Guidelines for API Protection for Cloud-Native Systems, as a final publication on June 27, 2025. It covers risks and controls across pre-runtime and runtime stages and recommends an incremental, risk-based approach. NIST has since published a March 2026 update (SP 800-228-upd1), so cite the current version.
CBUAE (UAE) expects secure Open Finance interfaces, and the Open Finance UAE API Security Standards build on the OpenID Foundation's FAPI 2.0 profile. Secondary sources also describe independent third-party penetration testing for critical functions and annual testing for cloud arrangements.
Compliance vendors describe SAMA and NCA (Saudi Arabia) as expecting regular penetration testing under the SAMA Cyber Security Framework and the NCA Essential Cybersecurity Controls. However, confirm the exact control numbers and frequencies in the primary documents.
The practical takeaway for a global audience is that a test program built on the OWASP API Security Top 10 and documented with evidence will satisfy the common core of these frameworks. Then map the evidence to each regulator's own wording, instead of building separate programs.
The most common API security testing mistakes are testing only the endpoints in the documentation, using one privileged token for every test, trusting a clean scan as proof that authorization works, and failing to retest after fixes. Each one produces a report that looks complete while real exposure remains, making them more dangerous than an obvious coverage gap.
Testing only what appears in the OpenAPI file or the developer portal misses the endpoints most likely to be weak: old versions, internal routes, debug paths, and features that shipped without documentation. A test plan built from the spec can only be as complete as the spec.
OWASP's Improper Inventory Management risk exists because APIs tend to expose more endpoints than traditional web applications, and because teams often stop tracking deprecated versions and exposed debug endpoints, leaving them reachable. Older versions are common because they were built before a security fix and may still accept requests the current version rejects. To avoid this mistake, build the test scope from several sources and compare them: the specification, gateway configuration, DNS and certificate records, traffic logs, and the API calls your own client applications make. Treat every difference as a finding to investigate, and test shadow and deprecated endpoints with the same rigor as the documented ones.
Running every test with a single high-privilege token hides authorization flaws because an administrator can do almost everything. A request that succeeds tells you nothing about whether a standard user could do the same.
Authorization testing needs identities that differ. Use at least two accounts per role so you can test one user's access to another user's records, along with an unauthenticated session and one account for each privilege level. Then run the same requests under each identity and compare results to a written role matrix. This setup is what makes Broken Object Level Authorization and Broken Function Level Authorization visible in the first place. It also pays off for test hygiene: when a lower-privilege token suddenly succeeds against an admin function, the difference is obvious because you have a baseline of what should have failed.
A clean automated scan shows that the tool found nothing it knows how to detect, not that your API enforces authorization correctly. Authorization flaws are the hardest category for scanners because the vulnerable request looks entirely valid.
OWASP's description of Broken Object Level Authorization says you should consider object-level checks in every function that accesses a data source using an ID supplied by the user. A scanner usually cannot know which records belong to which user, so it cannot tell whether a successful response was allowed. The same limit applies to business-logic abuse and chained flaws that span several requests. Use scans for what they do well, such as injection patterns, misconfiguration, and missing authentication, and pair them with role-aware tests and manual review for object-, property-, and function-level authorization. When reporting results, state what the scan did not cover so that a clean result is not read as a clean bill of health.
A reported vulnerability isn't resolved until a retest confirms it, because fixes often address one symptom while leaving the cause in place. A developer might block one endpoint while the same flaw remains reachable through another method, an older version, or a different parameter.
Plan retesting as part of the original engagement: every finding gets a reproducible request, a defined fix, and a verification step. When the fix ships, rerun the original request and then test variations around it, including other HTTP methods on the same path, sibling endpoints that share the code, and prior API versions. Confirm the fix didn't introduce a new problem, such as an error message that now leaks details.
Bring in external testers when your API handles regulated or high-value data, when a regulation or customer requires independent testing, or when your own team can no longer find new issues or lacks the time and expertise to test deeply. External testing adds independence, fresh perspective, and specialized skill, and it works best as a complement to the internal testing already running in your pipeline.
Internal testing has reached its limit when it keeps confirming the same results, can't cover what changed, or someone outside the team needs proof. Any one of these is a reason to consider outside help.
The first signal is independence. Some rules require it outright: VARA's Technology and Information Rulebook, for example, requires virtual asset service providers to engage a qualified, independent third-party auditor for vulnerability assessments and penetration testing at least annually and before introducing new systems, applications, or products. Other frameworks and customers ask for third-party evidence in similar ways, even when they do not mandate it.
The second signal is risk concentration. A new payment flow, an authentication redesign, an open finance integration, or a public API for partners all carry more risk than routine changes, and they deserve testers who have no stake in the design. The third is skill. Authorization chains, business logic abuse, and protocol-specific issues in GraphQL or SOAP are hard to test well without regular practice. The fourth is coverage drift: if releases ship faster than you can test, or if the last two rounds found only minor issues, the team may be missing what it isn't looking for. Fresh testers bring different assumptions and often find what familiarity hides.
A good scope document tells testers exactly what to test, how, and under what limits, so the engagement produces actionable findings and doesn't disrupt production. A vague scope is the most common reason an external test disappoints.
It should name the APIs, versions, hosts, and environments in scope, and state whether you'll test staging or production. It should list the authentication methods, provide test accounts for each role (at least two users per role so you can check object-level authorization), and include the API specification and any known undocumented endpoints. It should state what is out of bounds, such as third-party services you do not own, destructive actions, or denial-of-service testing, and set the testing window, rate limits, and a point of contact for emergencies. It should also set expectations for the result: the report format, how findings are rated, whether retesting after fixes is included, and how findings map to the OWASP API Security Top 10 or to any regulation you must satisfy. Written authorization from the system owner, covering any cloud provider rules that apply, belongs in the document as well.
The questions that matter most are about how the testers work, not about their tools. The answers show whether the engagement will find real authorization and logic flaws or only run a scan and format the output.
Ask how they test authorization across roles, and what they need from you to do it well. Ask how much of the work is manual and how much is automated, and what they do with findings from automated tools. Ask whether the person who scopes the test will also run it, and what experience that person has with your API style, whether REST, SOAP, GraphQL, or gRPC. Ask what a finding looks like: you want the exact request, the response, the affected role, and a specific remediation, not a generic description. Ask how they handle retesting, how long it takes, and whether it is included. Ask how they protect your data and credentials during and after the engagement, and how quickly they will tell you about a critical finding instead of waiting for the final report. Finally, ask what they won't test, since an honest answer tells you what the report can and cannot claim.
If you want a team to scope and run this kind of engagement, our penetration testing services cover API and application testing. Whichever provider you choose, the questions above apply equally.
Start with an inventory of what your API actually exposes, then test authorization across real roles, because that is where the most serious flaws hide and where scanners help least. Automate the repeatable checks in your pipeline, and bring in independent testers for your highest-risk APIs and wherever a regulator or customer expects outside evidence. Retest every fix, and feed each finding back into your regression suite so the same flaw cannot quietly return.
Run automated API security tests on every build or deployment, and run deeper manual testing at least annually and after any major change to authentication, authorization, or data handling. OWASP's DevSecOps guidance for the 2023 API Security Top 10 says that yearly scanning and penetration testing are no longer enough and recommends continuous security testing across the development life cycle. Some regulations set a minimum. VARA's rulebook, for example, requires independent testing at least annually and before introducing new systems, applications, or products. Treat any regulatory minimum as a floor, and set your real frequency by how often the API changes and how sensitive its data is.
No. API security testing is the broader practice of checking an API for weaknesses by any suitable method, including automated scans, schema-based tests, fuzzing, and code analysis. Penetration testing is one method within it: a goal-driven, mostly manual effort in which a tester tries to exploit weaknesses the way an attacker would. A pipeline scan is API security testing, but not a penetration test; an API penetration test is a form of API security testing. Most programs need both: automation for continuous coverage and penetration testing for deeper authorization and business-logic testing.
No. Automated tools reliably find known patterns such as injection, missing authentication, misconfiguration, and schema violations, and they run consistently on every build. They struggle with context-dependent flaws, such as whether one user can access another user's records, whether a role can call a function it shouldn't, and whether a legitimate feature can be abused at scale. OWASP's description of Unrestricted Access to Sensitive Business Flows notes that this risk doesn't necessarily come from implementation bugs, which is why a scanner may report nothing. Use automation for breadth and speed, and use manual testing for authorization, business logic, and high-risk APIs.
Functional testing checks that an API does what it is supposed to do, while security testing checks what it shouldn't allow. A functional test sends a valid request and confirms the correct response. A security test sends requests that should fail, such as another user's object ID, an expired token, or an unexpected field, and confirms that the API rejects them. An API can pass every functional test and still expose customer data because no functional test asks who can see it. Reusing your functional test suite as a starting point helps, but it doesn't replace security-specific tests.
Testing helps produce compliance evidence, but it rarely satisfies a requirement on its own. Compliance frameworks generally require a documented methodology, defined frequency, qualified or independent testers, retesting of fixes, and retained evidence. PCI DSS v4.0.1 covers APIs through its requirements for bespoke software, public-facing web applications, and penetration testing, though you should confirm the exact wording and numbering in the current standard. The same logic applies to other frameworks: map your test scope, frequency, and reports to the exact clauses that apply to you, and confirm with your assessor or regulator what counts as sufficient.
Start by discovering the API yourself, then build the missing documentation. Capture traffic from real clients (web and mobile) using an intercepting proxy, and review client code and configuration for endpoint paths. Check for hints in gateway configuration, DNS records, and logs. Check whether the service publishes a machine-readable description, such as an OpenAPI or WSDL file, or exposes a GraphQL schema, though you should not assume it does. Once you have a list of endpoints, methods, parameters, and roles, treat it as your working specification and run the normal methodology against it. Record every undocumented endpoint you find, since each one is also a finding about inventory management.