The OWASP API Security Top 10, as tests you can run
The OWASP API Security Top 10 is the list of what most often goes wrong in APIs. It's written for security people. This page turns each item into tests a developer or QA engineer can add to the collection they already have, and run in CI on every push.
Set up two users and two roles
Almost every check below needs at least:
userATokenanduserBToken: two ordinary users in different accounts or tenants,adminToken: an administrator,- an object that belongs to user A, with its id in
userAOrderId.
Store the tokens as secret variables in Staging. A pre-request script on the Security folder can log the users in and save fresh tokens; see pre-request script examples.
API1: Broken object level authorization
User B asks for user A's object by id. The answer must be 403 or 404, never 200.
pm.test('user B cannot read user A\'s order', () => {
pm.expect(pm.response.code).to.be.oneOf([403, 404]);
});Step by step: can user B read user A's data?
API2: Broken authentication
No token, an expired token, a tampered token, a token for another audience: all 401. After logout, the old token stops working. See JWT handling and logout and token revocation. Also: does the login endpoint slow down guessing? See brute-force protection.
API3: Broken object property level authorization
Two halves: the response returns fields the caller shouldn't see (password hashes, internal flags, other users' emails), and the request accepts fields the caller shouldn't set (role, isAdmin, balance). See excessive data exposure and mass assignment.
API4: Unrestricted resource consumption
Huge page sizes, giant bodies, too many requests. Check ?limit=100000 is capped, a 10 MB body gets 413, and a burst gets 429. See rate limits and request size limits.
API5: Broken function level authorization
An ordinary user calls an admin endpoint. The answer must be 403. See test admin endpoints.
API6: Unrestricted access to sensitive business flows
A flow that's fine once but harmful in bulk: buying the whole stock, creating thousands of accounts, redeeming a coupon twice. Write the "twice" test: run the same purchase or redeem request two times and check the second is refused.
pm.test('a coupon can be redeemed only once', () => {
pm.expect(pm.response.code).to.be.oneOf([409, 422]);
});API7: Server-side request forgery
Any field that takes a URL the server will fetch (webhooks, avatars from a URL, imports) must refuse internal addresses. See test SSRF in URL fields.
API8: Security misconfiguration
Missing security headers, verbose errors with stack traces, permissive CORS, plain HTTP. See security headers, error responses and CORS.
API9: Improper inventory management
Old versions and forgotten endpoints still running. Keep every endpoint in the collection (an OpenAPI import helps), and test that /v1 routes you've retired really return 404 or 410. See deprecation and sunset headers.
API10: Unsafe consumption of APIs
Your API trusts what a third-party API returns. Use a mock or a sandbox to return something unexpected (a huge body, a missing field, a redirect) and check your API fails safely instead of passing it on.
Run them in CI
Put the security requests in one folder and run it on every merge to staging:
requestarium run-collection "Orders API" --folder Security --env Staging --junit security.xmlA failing authorization test is a release blocker, not a flaky test. Don't put a pass-rate gate on this folder.