agentleFS
kaandgnshkaandgnsh/Claude-Blue/skills/api-security/api-authorization-testing/SKILL.md

api-authorization-testing

Skill0 starsChanged 11 days agoMITView on GitHub

Test API authorization defensively — broken object-level authorization (BOLA/IDOR), broken function-level authorization, broken object property level authorization (mass assignment, excessive data exposure) and tenant isolation — with multi-user test matrices in authorized environments. Use when validating an API before release, investigating a suspected IDOR, or building automated authorization regression tests.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only in environments and accounts you are authorized to test.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

API Authorization Testing

OWASP API Top 10 2023: API1 BOLA, API3 Broken Object Property Level Authorization, API5 Broken Function Level Authorization — the most common serious API flaws.

Test setup (staging or authorized test tenant)

  • At least two users per role in two different tenants: userA@tenant1, userB@tenant1, userC@tenant2, plus an admin and an unauthenticated client.
  • Objects owned by each user (orders, documents, profiles).
  • Capture requests from the app/spec (Burp/ZAP proxy, OpenAPI).

Test matrix

TestMethodExpected
BOLAReplay GET/PUT/DELETE /orders/{idOfUserA} with userB and userC tokens403/404, no data, logged
ID guessabilityAre IDs sequential? UUIDs don't fix BOLA but reduce enumerationAuthorization still enforced
Function levelCall admin endpoints (/admin/*, POST /users/{id}/roles) with user token; try HTTP method switching (GET→DELETE)403
Mass assignmentAdd fields to updates ("role":"admin", "tenantId":"other", "price":0, "isVerified":true)Ignored or rejected
Excessive data exposureInspect responses for fields not shown in UI (password hashes, tokens, other users' PII)Only necessary fields
Tenant isolationUse tenant-scoped IDs across tenants; filter params (?tenant=) manipulationDenied
GraphQLQuery objects by ID via nested resolvers; introspection in prodPer-resolver authorization

Example with curl:

curl -s -H "Authorization: Bearer $TOKEN_USER_B" https://staging.example.com/api/v2/orders/1001 -o /dev/null -w '%{http_code}\n'

Automate as integration tests in CI (parametrized over user × object × endpoint) so regressions are caught.

Fix guidance

Enforce authorization in a central layer using the authenticated principal (never IDs from the client to determine ownership), deny by default, response DTO allow-lists, schema validation rejecting unknown fields.

Safety

Only in environments and accounts you are authorized to test; do not access real customer data — if a production IDOR is found during incident work, stop, record minimal evidence, and escalate.

Related skills

api-schema-security, secure-code-review, dast-baseline, api-abuse-detection

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.