api-authorization-and-bola — Claude Code skill: BOLA and API authz
A playbook for testing API authorization: reaching other users' objects, calling functions your role should not have, and writing hidden fields.
npx skills add yaklang/hack-skills --skill api-authorization-and-bola -a claude-codeWhat api-authorization-and-bola does
The skill lays out an authorization test loop. You create two accounts, capture the create, read, update and delete flows as the first one, then replay every request with the second account's token. From there it moves to sibling endpoints, nested resources and alternate HTTP verbs on the same route.
A table lists the surfaces worth hitting: object reads like /api/v1/orders/123, nested objects like /api/v1/users/1/invoices/9, admin routes like /api/v1/admin/users, PUT, PATCH and DELETE variants, plus hidden JSON fields such as role, org, verified and tier. A separate section covers what testers skip — object IDs sitting in headers, cookies, GraphQL arguments and nested objects, and routes where the parent check exists but the child resource has none. That last one is why alternate methods on a shared route deserve a look.
This is an offensive security skill, not something to point at production. Run it against your own staging environment or a target you have written permission to test, because replaying another account's token against live data is real access, not a probe. When the problem sits in the token layer, the skill routes you to ../api-auth-and-jwt-abuse/SKILL.md; for GraphQL and hidden parameter discovery, to ../graphql-and-hidden-parameters/SKILL.md.
What it helps with
- check whether an API returns another user's object by direct ID
- find admin or internal functions an ordinary role can still call
- catch hidden fields like
roleorverifiedthat an update request accepts - compare how
PUT,PATCHandDELETEare protected on the same route - test a nested resource that has no parent check
Example prompts for the agent
- run the api-authorization-and-bola playbook against
/api/v1/orders/{id}with two accounts - use the skill to check whether
PATCH /api/v1/users/1accepts arolefield - walk through api-authorization-and-bola and compare
/api/v1/users/1/invoices/9with tokens A and B
How to install api-authorization-and-bola
1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill api-authorization-and-bola -a claude-code2Manually: put the files in place
~/.claude/skills/api-authorization-and-bola/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/api-authorization-and-bola/
1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill api-authorization-and-bola -a codex2Manually: put the files in place
.agents/skills/api-authorization-and-bola/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill api-authorization-and-bola -a cursor2Manually: put the files in place
.cursor/skills/api-authorization-and-bola/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install yaklang/hack-skills api-authorization-and-bola2Manually: put the files in place
.github/skills/api-authorization-and-bola/SKILL.md1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill api-authorization-and-bola -a gemini-cli2Platform CLI
gemini skills install https://github.com/yaklang/hack-skills --path skills/api-authorization-and-bolaManually: put the files in place
.devin/skills/api-authorization-and-bola/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill api-authorization-and-bola -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about api-authorization-and-bola
How do I install api-authorization-and-bola in Claude?
Run npx skills add yaklang/hack-skills --skill api-authorization-and-bola -a claude-code. The skill file then lives at ~/.claude/skills/api-authorization-and-bola/SKILL.md.
What does api-authorization-and-bola do?
It gives a focused authorization test path: BOLA on objects, function-level access for the wrong role, method abuse, and control over hidden fields.
Which skills does it link to next?
Token-layer abuse routes to api-auth-and-jwt-abuse, GraphQL and hidden parameter discovery to graphql-and-hidden-parameters, and IDOR outside APIs to idor-broken-object-authorization.
Source text
SKILL.md · MIT
---
name: api-authorization-and-bola
description: >-
API authorization and BOLA testing playbook. Use when APIs expose object identifiers, nested resources, hidden writable fields, or weak function-level authorization.
---
# SKILL: API Authorization and BOLA — Object Access, Function Access, and Mass Assignment
> **AI LOAD INSTRUCTION**: Use this skill when an API exposes object IDs, nested resources, or role-sensitive functions and you need a focused authorization test path: BOLA, BFLA, method abuse, and hidden field control.
## 1. CORE TEST LOOP
1. Create Account A and Account B.
2. As Account A, capture create, read, update, and delete flows.
3. Replay with Account B's token.
4. Test sibling endpoints, nested endpoints, and alternate HTTP verbs.
## 2. TEST SURFACES
| Surface | Example |
|---|---|
| object read | `/api/v1/orders/123` |
| nested object | `/api/v1/users/1/invoices/9` |
| admin or internal function | `/api/v1/admin/users` |
| update path | `PUT`, `PATCH`, `DELETE` variants |
| hidden JSON fields | `role`, `org`, `verified`, `tier` |
## 3. QUICK PAYLOADS
```json
{"role":"admin"}
{"isAdmin":true}
{"org":"target-company"}
{"verified":true}
```
## 4. WHAT TESTERS MISS
- object IDs in headers, cookies, GraphQL args, and nested objects
- alternate methods sharing the same route but weaker authz
- parent check present, child resource check missing
- admin docs revealing extra writable fields
## 5. NEXT ROUTING
- For JWT or token-layer abuse: [api auth and jwt abuse](../api-auth-and-jwt-abuse/SKILL.md)
- For GraphQL and hidden parameter discovery: [graphql and hidden parameters](../graphql-and-hidden-parameters/SKILL.md)
- For broader IDOR patterns outside APIs: [idor broken object authorization](../idor-broken-object-authorization/SKILL.md)
© yaklang · MIT · yaklang/hack-skills