Reviewing API Security
Core principle
API security is primarily about enforcing identity, authorization, resource, and business invariants on every reachable operation. Never assume a client, gateway, hidden field, or route naming convention provides authorization.
Scope rule
Assess only APIs and environments the user is authorized to review. Prefer source, schemas, policies, logs, controlled test identities, and local/staging requests. Avoid destructive load, data modification, or probing unrelated systems.
Workflow
- Inventory the API surface: routes, methods, versions, schemas, webhooks, background consumers, admin APIs, internal endpoints, outbound API calls, and deprecated routes still deployed.
- Classify identities and privilege levels. Include anonymous, user, tenant, service, admin, machine credentials, and delegated identities.
- Review authentication and token handling: issuer/audience, expiry, revocation where required, signature verification, credential transport/storage, and failure behavior.
- Review authorization at three distinct levels:
- object: may this identity access this specific record/resource?
- property: may it read or change each exposed sensitive field?
- function: may it invoke this operation at all?
- Review data binding and serialization. Use explicit schemas/allowlists for mutable fields and avoid returning internal or privileged properties by default.
- Review resource and workflow abuse: pagination/bulk sizes, expensive operations, retries, uploads, account creation, reservations, coupon/payment-like flows, enumeration, and automation-sensitive actions. Apply limits where the business invariant requires them.
- Review server-initiated requests and third-party API consumption. Constrain destinations/protocols, validate redirects, bound time/size, treat upstream data as untrusted, and avoid propagating excessive privileges.
- Review configuration and inventory: CORS, error detail, debug routes, API versions, documentation exposure, unused endpoints, secrets, and environment drift.
- Validate findings with controlled identities and minimal requests. Prove the violated invariant without collecting unrelated data or increasing impact.
Authorization matrix
For sensitive operations, record:
- route/operation;
- resource owner/tenant;
- allowed identities/roles;
- object and property rules;
- server-side enforcement point;
- expected denial behavior;
- automated or manual verification evidence.
Quality checks
A review is weak when it:
- tests only authentication but not per-object/per-function authorization;
- trusts client-supplied ownership, role, price, status, or tenant identifiers;
- ignores sensitive business flows because requests are individually valid;
- treats rate limiting as a universal substitute for authorization;
- reports API Top 10 labels without evidence tied to the actual contract.
Verification
For each high-risk finding, repeat the controlled request using the least-privileged relevant identity and confirm the server enforces the intended invariant after remediation. Add a regression test when the boundary can be exercised deterministically.
References
1---2name: reviewing-api-security3description: Use when an authorized API or backend boundary needs security review for authentication, object/function/property authorization, resource abuse, business-flow abuse, SSRF, configuration, inventory, and third-party consumption.4---56# Reviewing API Security78## Core principle9API security is primarily about enforcing identity, authorization, resource, and business invariants on every reachable operation. Never assume a client, gateway, hidden field, or route naming convention provides authorization.1011## Scope rule12Assess only APIs and environments the user is authorized to review. Prefer source, schemas, policies, logs, controlled test identities, and local/staging requests. Avoid destructive load, data modification, or probing unrelated systems.1314## Workflow151. Inventory the API surface: routes, methods, versions, schemas, webhooks, background consumers, admin APIs, internal endpoints, outbound API calls, and deprecated routes still deployed.162. Classify identities and privilege levels. Include anonymous, user, tenant, service, admin, machine credentials, and delegated identities.173. Review authentication and token handling: issuer/audience, expiry, revocation where required, signature verification, credential transport/storage, and failure behavior.184. Review authorization at three distinct levels:19 - object: may this identity access this specific record/resource?20 - property: may it read or change each exposed sensitive field?21 - function: may it invoke this operation at all?225. Review data binding and serialization. Use explicit schemas/allowlists for mutable fields and avoid returning internal or privileged properties by default.236. Review resource and workflow abuse: pagination/bulk sizes, expensive operations, retries, uploads, account creation, reservations, coupon/payment-like flows, enumeration, and automation-sensitive actions. Apply limits where the business invariant requires them.247. Review server-initiated requests and third-party API consumption. Constrain destinations/protocols, validate redirects, bound time/size, treat upstream data as untrusted, and avoid propagating excessive privileges.258. Review configuration and inventory: CORS, error detail, debug routes, API versions, documentation exposure, unused endpoints, secrets, and environment drift.269. Validate findings with controlled identities and minimal requests. Prove the violated invariant without collecting unrelated data or increasing impact.2728## Authorization matrix29For sensitive operations, record:30- route/operation;31- resource owner/tenant;32- allowed identities/roles;33- object and property rules;34- server-side enforcement point;35- expected denial behavior;36- automated or manual verification evidence.3738## Quality checks39A review is weak when it:40- tests only authentication but not per-object/per-function authorization;41- trusts client-supplied ownership, role, price, status, or tenant identifiers;42- ignores sensitive business flows because requests are individually valid;43- treats rate limiting as a universal substitute for authorization;44- reports API Top 10 labels without evidence tied to the actual contract.4546## Verification47For each high-risk finding, repeat the controlled request using the least-privileged relevant identity and confirm the server enforces the intended invariant after remediation. Add a regression test when the boundary can be exercised deterministically.4849## References50- OWASP API Security Top 10:2023: https://owasp.org/API-Security/editions/2023/en/0x11-t10/51- OWASP Application Security Verification Standard 5.0.0: https://owasp.org/www-project-application-security-verification-standard/52- OWASP Top 10:2025: https://owasp.org/Top10/2025/