API penetration testing simulates real-world attacks against your API endpoints to validate authentication, authorisation, and data-exposure controls. The single most important operational decision is to run tests in authenticated grey-box mode with cross-user checks, because most serious API flaws only surface once a tester has a valid identity. The OWASP API Security Top 10 and NCSC penetration testing guidance set the baseline for scope and rigour.
TL;DR:
- Running authenticated grey-box tests with cross-user checks is essential to uncover core authorization flaws like BOLA and BOPLA that often only surface with valid identities.
- Scope should include all endpoint versions, especially deprecated ones, and differential testing can reveal missing security controls or outdated configurations.
- Automated tools like OWASP ASTF are helpful for broad coverage but require manual validation of critical findings, especially for cross-user and business-logic flaws.
- Chain attack testing across multiple steps and third-party integrations uncovers complex vulnerabilities that single requests may miss, including race conditions and authorization bypasses.
- Regular testing after major releases, API changes, or security incidents ensures vulnerabilities are caught early, maintaining effective vulnerability management.
Table of Contents
- Why APIs need dedicated penetration tests
- Scoping and engagement models for an API pentest
- How do you run an API pentest step by step?
- What tools cover API security testing, and where do they fall short?
- Reporting and severity triage that engineering teams can act on
- How Solusec applies this methodology in practice
- API schema and specification fuzzing techniques
- Testing API integrations and chaining attacks across multiple steps
- Handling and testing API versioning and deprecated endpoints
- Testing for injection vulnerabilities specific to API inputs
- Techniques for testing API encryption and sensitive data exposure
- When should you actually schedule an API pentest?
- Book an API penetration test with Solusec
- Sources
- FAQ
Why APIs need dedicated penetration tests
A web application firewall protects the front door. It says nothing about what happens once a legitimate, logged-in user starts poking at object IDs that belong to somebody else. That's the core difference between API testing and traditional web app testing: APIs expose business logic directly, often with minimal presentation-layer friction, and a single malformed request can return another customer's invoice, medical record, or password hash.
Weak or legacy authentication, missing rate limits, and excessive data in API responses have driven some of the largest breaches on record, and NCSC's guidance on securing HTTP-based APIs calls out exactly these failure modes.
The OWASP API Security Top 10 (2023) gives you the priority list:
- API1 Broken Object Level Authorization (BOLA): a user can access another user's data by changing an ID in the request.
- API2 Broken Authentication: weak tokens, missing MFA, or predictable session handling.
- API3 Broken Object Property Level Authorization (BOPLA): an endpoint returns or accepts fields it shouldn't (mass assignment, excessive data exposure).
- API4 Unrestricted Resource Consumption: no rate limiting, allowing denial-of-service or cost-based attacks.
- API5 through API10: cover function-level authorisation, business flow abuse, server-side request forgery, misconfiguration, inventory management, and unsafe consumption of third-party APIs.
Pro Tip: Treat the OWASP list as a scoping checklist, not a report template. Map every test case you run back to a specific category before the engagement starts, so gaps are visible before the tester leaves.
Scoping and engagement models for an API pentest
A poorly scoped API test wastes budget on shallow coverage or, worse, breaks production systems. NCSC frames a well-run engagement in five phases: initial engagement, scoping, testing, reporting, and follow-up, and that structure applies just as cleanly to APIs as it does to networks.
- Initial engagement: agree objectives, systems in scope, and who holds legal authority to grant permission.
- Scoping: define black, grey, or white box access, list environments (staging versus production), and confirm which user roles need test accounts.
- Testing: execute against agreed timeslots with a technical point of contact on standby.
- Reporting: deliver evidence-backed findings with clear reproduction steps.
- Follow-up: retest fixed issues and confirm closure.
Black-box testing (no credentials) tells you what an anonymous attacker sees, which is useful but narrow. White-box testing (source code access) is thorough but slow and rarely matches how a real attacker operates. Grey-box testing, where the tester holds at least one authenticated token and ideally a second "victim" account, uncovers the authorisation flaws that actually cause damage. ASTF's own testing guidelines recommend supplying at least one authenticated token for exactly this reason.
Operationally, insist on a safe-mode or dry-run pass before destructive checks, agreed testing windows outside peak traffic, and a written technical proof-of-concept for anything that could trigger data loss or service disruption.
How do you run an API pentest step by step?
Most engagements follow four overlapping phases: reconnaissance, discovery, authorisation testing, and targeted exploitation of business logic. Skipping recon is the most common reason automated scans miss high-value endpoints.
Reconnaissance starts before a single request hits the target:
- Search for exposed OpenAPI or Swagger specifications, which frequently document undocumented parameters.
- Read the application's JavaScript for hardcoded endpoints, API keys, or internal hostnames.
- Capture HAR files from normal application use to see real traffic patterns.
- Use Git dorking against public repositories and the Wayback Machine to find deprecated or forgotten versions still running in production. OWASP's own reconnaissance guidance treats these as standard discovery sources, not optional extras.
Discovery builds on recon: spider the application, review proxy logs, and run wordlist bruteforce against likely path patterns (/api/v2/, /internal/, /admin/) to surface endpoints nobody documented.
Authorisation testing is where the real value sits. Swap the numeric or UUID identifier in a request for another account's ID while authenticated as a different user, this is the core BOLA test. Try the same request with a lower-privilege token to check for broken function-level access. Send extra fields in a write request to probe for mass assignment (BOPLA).
Pro Tip: Keep a second, low-privilege test account provisioned from day one. Almost every meaningful authorisation flaw needs a "victim" identity to prove exploitation, and requesting one mid-engagement stalls the whole test.
Round out the methodology with injection payloads tuned to the API's actual data format, timing-based checks for regular-expression denial-of-service (ReDoS), server-side request forgery probes on any endpoint that accepts a URL, and rate-limit testing by firing repeated authenticated requests to see where (or whether) throttling kicks in.
What tools cover API security testing, and where do they fall short?
Automation earns its keep on coverage and speed, not judgement. The OWASP API Security Testing Framework (ASTF) runs sixteen automated test cases mapped directly to the OWASP API Top 10, plus additional coverage for GraphQL, gRPC, mTLS, and LLM-backed endpoints.
- Run ASTF in grey-box mode, feeding it authenticated tokens and an endpoints file, since most of its meaningful checks (BOLA, BOPLA, function-level authorisation) need an authenticated context to mean anything.
- Export findings as HTML for stakeholders, JSON for pipeline integration, or SARIF for feeding straight into existing security tooling.
- Use the
--secondary-tokenoption (or equivalent in whichever scanner you run) to unlock genuine cross-user authorisation testing rather than single-identity checks that miss BOLA entirely.
None of this replaces a human. ASTF's testing guidelines are explicit that any CRITICAL or HIGH finding needs manual replay before it goes in a report, and that timing-based ReDoS detections in particular need re-running to rule out network jitter producing a false positive. Reproduce every serious finding with a plain curl command, manually verify cross-user exploits with two real accounts side by side, and only then write it up.
Reporting and severity triage that engineering teams can act on
A pentest report that nobody can action is a wasted budget line. Build the checklist around evidence first, opinion second.
- Inventory before testing: list every endpoint, every authentication context, and every user role you plan to test, so nothing gets skipped or double-counted.
- Capture full request and response detail for every finding, headers, body, status codes, so a developer can see exactly what happened without re-running the attack themselves.
- Attach a reproduction command, ideally a working
curlsnippet, for every issue rated medium or above. - Triage using CVSS or CHECK-style severity context, not gut feel, and rank by exploitability and business impact together.
- Write remediation-first: state what to fix, not just what broke, and agree a retest window to confirm closure.
NCSC's own framing is useful here: penetration testing is an assurance activity, closer to a financial audit than a discovery exercise. It confirms whether your internal vulnerability management processes are actually working, rather than replacing them outright.
How Solusec applies this methodology in practice
Solusec runs API engagements as a CREST-accredited provider, which means the methodology above isn't theoretical, it's the baseline every test is measured against. Clients speak directly to the testers doing the work, not an account manager relaying findings secondhand.
- Automated ASTF-style scanning covers breadth quickly, catching missing rate limits, obvious authorisation gaps, and schema violations early in the engagement.
- Every high or critical automated finding gets manually verified, particularly cross-user BOLA checks and business-logic abuse that scanners routinely miss.
- Clients receive plain-English findings tied to reproduction evidence, with remediation guidance they can hand straight to a development team, plus follow-up support to confirm fixes actually close the gap.
That combination, automated coverage plus manual confirmation, is what keeps a report from becoming a 60-page list of theoretical issues nobody has time to fix.
API schema and specification fuzzing techniques
Fuzzing an API against its own schema finds the gap between what the specification promises and what the code actually enforces. Feed an OpenAPI or Swagger definition into a fuzzer, and it can automatically generate malformed requests: wrong data types, out-of-range integers, oversized strings, missing required fields, and unexpected enum values, then check whether the backend rejects them cleanly or throws an unhandled exception.
The interesting findings usually sit at the boundary. An endpoint that accepts a quantity field defined as a positive integer but never actually validates the "positive" part will often accept negative values, which can break downstream business logic in ways a functional tester would never think to try. Schema fuzzing catches this because it doesn't reason about intent, it just tries everything the type system technically allows and a bit more besides.
Type confusion deserves particular attention. Sending a string where an integer is expected, or an array where the schema defines an object, frequently reveals stack traces in the response, information that hands an attacker internal file paths, framework versions, or database error messages for free. Depth-based fuzzing on nested JSON objects can also trigger denial-of-service conditions in poorly configured parsers, since some libraries recourse without a depth limit.
Version drift between the published specification and the live API is another common finding. Fuzz the documented spec, then fuzz the endpoints discovered through reconnaissance that never made it into the documentation, undocumented fields often skip validation entirely because nobody expected them to be reachable. Where GraphQL is in play, schema introspection queries should be tested directly: if introspection is left enabled in production, an attacker gets the entire object graph, mutations included, without guessing a single field name.
Testing API integrations and chaining attacks across multiple steps
Single-request testing misses the vulnerabilities that only appear across a sequence of calls. Most meaningful business-logic flaws in APIs are chain attacks: individually harmless requests that, executed in the wrong order or with a manipulated parameter partway through, produce an outcome the application never intended.
A common pattern: an e-commerce API that calculates a discount in one call, applies it in a second, and finalises payment in a third. Tested in isolation, each endpoint behaves correctly. Tested as a chain, replaying the discount-calculation response after changing the cart contents can apply a stale discount to a completely different order. Race conditions surface the same way, firing two "redeem voucher" requests simultaneously can double-spend a single-use code if the backend doesn't lock the resource between the check and the update.
Integration points with third-party APIs deserve their own pass. If your API calls out to a payment processor, an identity provider, or a partner system, test what happens when that upstream call is slow, fails, or returns an unexpected payload. A webhook that isn't properly authenticated lets an attacker forge a "payment confirmed" callback and skip payment entirely, a real-world variant of API10's unsafe consumption of third-party APIs.
Mapping these chains takes patience: capture a full legitimate user journey with a proxy, then systematically replay steps out of order, skip steps, or substitute parameters from a different session. It's slower than single-endpoint testing, and it's also where the highest-impact findings tend to live.

Handling and testing API versioning and deprecated endpoints
Old API versions rarely die, they just stop getting attention. A /v1/ endpoint superseded by /v2/ two years ago is often still live, still authenticated with whatever scheme was current at the time, and frequently missing every security fix applied to its replacement since.
Start by enumerating every version a target has ever shipped, not just the one currently documented. Reconnaissance against the Wayback Machine, old mobile app builds (which hardcode API base URLs and rarely get updated by users), and Git history routinely turns up version paths nobody remembers exists. Test each one independently rather than assuming security controls are consistent across versions, because they usually aren't.
Deprecated endpoints deserve deliberate probing for authentication downgrade: does the old version accept a weaker token format, skip a rate limit the new version enforces, or expose fields the current schema deliberately hides? Differential testing, running the same authenticated request against /v1/ and /v2/ and comparing the responses, is one of the fastest ways to spot where a fix was applied to the new version and never backported.
Sunset headers and deprecation notices are worth checking too, not for their presence but for whether they're enforced. An API returning a Deprecation header while the endpoint remains fully functional with no access restriction is a governance gap as much as a technical one: a good tester flags it as a remediation item even where no direct exploit exists, because deprecated code that nobody actively patches is where the next exploitable bug tends to surface first.
Testing for injection vulnerabilities specific to API inputs
Injection in APIs behaves differently to injection in a traditional web form, mainly because API inputs are structured data, JSON, XML, or binary, rather than free text in an HTML field, and that structure changes both where flaws hide and how you find them.
SQL injection still matters, particularly in APIs built quickly on top of ORM shortcuts or raw query strings assembled from JSON body fields. Test every parameter that eventually touches a database query, including ones buried in nested objects or array elements, since developers often sanitise top-level fields and forget the ones two layers deep.
NoSQL injection is the API-specific variant worth extra attention. MongoDB-backed APIs that pass JSON bodies straight into query operators are vulnerable to payloads like {"$ne": null} in a password field, which can bypass authentication entirely by matching any non-null value. This class of flaw barely exists in traditional form-based testing and gets missed constantly by testers used to classic SQL payloads.
XML injection and XXE (XML External Entity) attacks apply directly to any API still accepting XML or SOAP payloads, common in legacy enterprise integrations, and can be used to read local files or trigger server-side request forgery through a maliciously crafted entity reference.
Command injection surfaces in APIs that shell out to system utilities, file conversion endpoints, image processors, and PDF generators are frequent offenders. Test any parameter that influences a filename, format flag, or processing option with standard command-chaining payloads, and watch response timing as much as response content, since a blind injection may not echo output but will delay the response predictably.
Techniques for testing API encryption and sensitive data exposure
Transport encryption is the easy check and the one most teams already get right: confirm TLS is enforced on every endpoint, certificates are valid and not self-signed in production, and older protocol versions (TLS 1.0, TLS 1.1) are disabled. Where the API supports mutual TLS, verify certificate validation is actually enforced server-side rather than merely offered as an option.
The harder, more valuable checks sit above the transport layer. Response bodies routinely leak more than the client needs: a /users/me endpoint returning a full password hash, internal database ID, or another user's partial data alongside the legitimate response is a textbook case of excessive data exposure (OWASP API3). Compare every field an API returns against what the front-end actually displays, the gap between the two is where sensitive data leaks live.
Token and credential storage deserves direct scrutiny too. Check whether API keys or session tokens appear in URL query strings (which get logged by proxies, browsers, and analytics tools by default), whether tokens are long-lived with no rotation, and whether error messages echo back sensitive input like full stack traces or database connection strings. NCSC's guidance on secure development practices for HTTP-based APIs is explicit that validation and encryption boundaries shouldn't rely on a single gateway layer. If the only thing standing between an attacker and unencrypted internal data is an API gateway configuration, that's a single point of failure worth flagging on its own. Regulated systems handling sensitive personal or clinical data carry an additional layer of validation obligation worth checking against, a principle covered well in this GxP validation lifecycle guide for AI and regulatory teams.
Encryption at rest is worth a direct question to the engineering team even where it can't be tested externally: are API keys, refresh tokens, and any cached PII encrypted in the database, or stored in plain text because "the database is internal anyway"?

When should you actually schedule an API pentest?
Cadence matters more than most teams assume. Test at every major release, whenever a new API ships, and always after a security incident, waiting for an annual calendar slot leaves months of drift untested. A pentest verifies that your internal vulnerability management is catching what it should, it isn't a substitute for that process, and treating it as one leaves gaps between engagements that nobody's watching. Independent, CREST-accredited testers earn their fee specifically on engagements where internal teams need assurance a reviewer with no stake in the code's history can actually deliver.
— Solusec Admin
Book an API penetration test with Solusec
The direct route to a properly scoped API penetration test is to work with accredited testers who talk to you directly rather than through a sales layer. Every engagement follows the grey-box methodology covered above: authenticated tokens, cross-user checks, manual verification of anything automated scanning flags as critical or high.

A typical engagement starts with scoping (which endpoints, which roles, which environment), move into grey-box testing with real authenticated tokens, and finishes with a plain-English report built around reproduction evidence rather than raw scanner output, plus remediation support once findings land with your development team. If your API sits behind a wider infrastructure estate, Solusec's penetration testing service covers the full external footprint. Organisations building a longer-term testing cadence can look at continuous penetration testing rather than a single point-in-time check. For teams also working towards baseline compliance, Cyber Essentials certification is priced from £320 to £600 depending on organisation size, with a £100 urgent turnaround fee available where deadlines are tight.
Get in touch to scope your next API engagement and get a fixed quote back within days.
Sources
FAQ
What Are the 9 Types of API Testing?
API testing generally covers functional, unit, integration, validation, UI, load, security, runtime error, and fuzz testing. Penetration testing sits specifically within security and fuzz testing, focused on exploiting authentication, authorisation, and input-handling flaws rather than confirming expected behaviour.
What Are the Best Tools for API Penetration Testing?
The OWASP API Security Testing Framework (ASTF) is the primary open, purpose-built option, running automated checks mapped to the OWASP API Top 10 with grey-box support via tokens. Manual verification with curl, a proxy for traffic capture, and a fuzzer for schema testing round out a full toolkit alongside it.
How Do I Perform API Testing for Security?
Start with reconnaissance to find every endpoint (including undocumented and deprecated ones), then run authenticated grey-box tests covering the OWASP API Top 10, prioritising cross-user authorisation checks. Follow any automated scan with manual reproduction of critical and high findings before reporting.
What Are the 5 API Methods?
The five core HTTP methods used in REST APIs are GET, POST, PUT, DELETE, and PATCH, each mapping to a different data operation (read, create, replace, remove, and partial update). Penetration testers check that authorisation controls apply consistently across all five, since a common flaw is an endpoint that enforces access checks on GET but not on the corresponding to DELETE or PATCH call.
How Much Does an API Penetration Test Cost?
Pricing depends on scope, complexity, and the number of endpoints and roles involved, so current rates are best confirmed directly with a provider. Solusec's penetration testing covers external IP testing at 3000 £ one-off and CMS website testing at 2500 £ one-off, with API-specific scoping quoted individually based on the engagement.
Recommended
- CMS Website Penetration Test
- External IP Penetration Test
- Continuous Penetration Testing
- Annual Penetration Testing
This article was created with assistance of AI. We never use AI with your data unless given explicit permission.
