Back to blog
Application Security

App Pentesting vs API Security Testing

A web application test may cover its APIs, but the scope needs to say how. Plan coverage across browser workflows, direct requests, roles, and API versions.

Date
04/10/2024
Read
2 min read
Cat
Application Security

A web application test can include API testing. Whether it does depends on the scope, the endpoints the tester knows about, and the accounts available for testing. The label on the engagement is not enough to establish coverage.

This matters when the browser uses only part of an API. A mobile client may use another version, a partner may have access to additional operations, and an old endpoint may still be reachable even though the current interface no longer calls it.

Testing through the application

Starting in the application helps a tester understand what users are supposed to do. Registration, login, account recovery, checkout, and administrative workflows provide context for evaluating session handling and business logic.

The tester also needs to inspect and modify the requests behind those workflows. Hiding a button or filtering a dropdown does not establish that the server rejects the corresponding request. Authorization checks have to hold when the caller changes parameters or sends a request without using the interface.

Testing the API directly

An API-focused assessment starts with the service's operations, inputs, and permissions. Documentation, endpoint inventories, and sample requests help identify functionality that a browser walkthrough might not encounter.

Useful questions include whether one account can access another account's objects, whether a request can set fields the caller should not control, and whether a response exposes more data than the caller needs. Rate limits and resource consumption also belong in scope where repeated calls can cause damage or substantial cost.

The OWASP API Top 10 provides a useful set of risk categories. The assessment still needs to relate those categories to the application's actual roles and data.

Agreeing on coverage

Before testing starts, identify the web and mobile clients, API versions, partner integrations, and administrative endpoints involved. Provide accounts with different roles and, where relevant, accounts in separate customer organizations. A tester with only one account has less evidence about whether tenant boundaries hold.

Then agree which workflows and endpoints will be exercised directly. If an engagement covers only the requests observed in the web interface, say so in the scope and report.

For a product with a web interface and API, it is often sensible to test them together. The important deliverable is a clear record of what was tested, which access boundaries were exercised, and what remains outside the assessment.

Written by

Diego Ramirez

Head of Zero Day Research at PlatformSecurity, running the firm's vulnerability discovery program. 30+ published CVEs across embedded systems and enterprise software, with deep expertise in exploit development, fuzzing, and reverse engineering.

Share

More in Application Security

All posts