Skip to main content

API Security Testing: 7 Checks for Access Control Gaps

Updated 4 min readMarkdown

API security testing checks whether each caller can access only the data and actions their permissions allow.

Start with a written permissions map, approved test accounts, and test-owned records. Then run these seven checks (part of a broader OWASP API Top 10 checklist):

  • Missing or invalid credentials: Protected requests must return no private data and make no changes.

  • Cross-user access: One user must not read, change, or delete another user’s private records.

  • Cross-tenant access: Requests must stay within the caller’s allowed tenant boundaries.

  • Restricted functions: Lower-privilege roles must not run admin-only actions.

  • Field visibility: Responses must exclude fields the caller cannot read.

  • Protected fields: Create and update requests must not save field changes the caller cannot make.

  • Alternate paths: Methods, routes, versions, and GraphQL resolvers must enforce the same permissions.

A status code alone does not prove a check passed. Inspect response data, verify changes from the owner’s account, and save request-response records. Report only confirmed gaps, then retest fixes alongside allowed access.

The full post walks through each check with expected responses, what to record, and how to classify results: API Security Testing: 7 Checks for Access Control Gaps.

Conclusion: Repeat the Checks and Verify Fixes

Repeat the checks against the documented permissions model. Retest the same roles, tenants, routes, and methods.

Verify both denied requests and legitimate access. Use controlled records and save an owner-session baseline. Confirm that writes without permission leave records unchanged, while permitted writes still succeed.

Once you’ve confirmed the evidence, rank fixes by impact: confirmed exposure, changes made without permission, and actions taken without permission. Before closing a finding, check sibling routes and alternate methods. Add automated two-account matrix tests for new routes and object types, and use that same matrix as a regression gate.

If testing capacity is limited, scope the assessment to the relevant roles, tenants, and routes. Include verified findings, guidance on fixes, testing limits, and fix verification.

FAQs

How do I test APIs with undocumented permissions?

Find hidden endpoints by comparing official API documentation with client-side code and network traffic, or by probing older API versions.

Use the two-account method to test each route with a low-privilege token. Check whether the response returns data or completes a state change that the account shouldn't be allowed to access or perform.

Include control requests using a nonexistent ID, an anonymous session, and the correct owner’s token. These checks help separate authorization failures from intended behavior.

Which access control checks should I prioritize?

Prioritize authorization testing at the object level (BOLA/IDOR), function level, and property level. Sign in as User A, then use User B’s resource identifiers to check whether User A can access or modify those resources.

For each object type, test every HTTP method and all read, write, delete, and share operations. After each change, retrieve the object as its owner to confirm whether the unauthorized change persisted. Use nonexistent IDs and anonymous requests as controls to check your results.

How can I safely automate authorization tests?

Stay within the approved scope and use test-owned accounts and data. Record a baseline, then replay the same request from a second account to check for cross-user or cross-tenant effects. Verify destructive changes by reading back the results, not just relying on “200 OK.” Test nonexistent IDs, anonymous or unsigned tokens, and wrong or invalid signatures.

Report only confirmed effects. Save requests, responses, and timestamps as evidence, and retest fixes using the same evidence checks. (sources: IDOR testing guide, OWASP API Security Top 10 guide, multi-tenant isolation testing guide)


First published on excessionlabs.ai.

About the author

  • Excession Labs is a security lab. We run authorized penetration tests and AI red teaming for web apps, APIs and AI products.

No comments yet. Be the first to comment.