testing-api-for-broken-object-level-authorization
Teaches your AI agent to test code and catch bugs before users do and build APIs and back-end systems.
What it does
This tool checks if an online system (API) allows one user to access or modify another user's data without permission. It does this by testing different object identifiers.
When to use it
- ✓When testing the security of an online system.
- ✓When you want to ensure users cannot access each other's data.
- ✓When verifying if a system correctly protects individual data.
Example of what to ask your AI
“Check if the API allows user A to access user B's orders.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool tries to use the identifier of an object (like an order number) belonging to one user, but with another user's credentials. If access is granted, the system has a security flaw.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill testing-api-for-broken-object-level-authorizationOr download just the file:
curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/testing-api-for-broken-object-level-authorization/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Testing API for Broken Object Level Authorization
When to Use
- Assessing REST or GraphQL APIs that use object identifiers in URL paths, query parameters, or request bodies
- Performing OWASP API Security Top 10 assessments where API1:2023 (BOLA) must be tested
- Testing multi-tenant SaaS applications where users from different tenants should not access each other's data
- Validating that API endpoints enforce per-object authorization checks beyond just authentication
- Evaluating APIs after new endpoints are added to ensure authorization middleware is applied consistently
Do not use without written authorization from the API owner. BOLA testing involves accessing or attempting to access other users' data, which requires explicit permission.
Prerequisites
- Written authorization specifying the target API endpoints and scope of testing
- At least two test accounts with different privilege levels and distinct data sets
- Burp Suite Professional or OWASP ZAP configured as an intercepting proxy
- Authentication tokens (JWT, session cookies, API keys) for each test account
- API documentation (OpenAPI/Swagger spec) or access to enumerate endpoints
- Python 3.10+ with
requestslibrary for scripted testing - Autorize Burp extension installed for automated BOLA detection
Workflow
Step 1: API Endpoint Discovery and Object ID Mapping
Enumerate all API endpoints and identify parameters that reference objects:
From OpenAPI/Swagger Specification:
# Download and parse the OpenAPI spec
curl -s https://target-api.example.com/api/docs/swagger.json | python3 -m json.tool
# Extract all endpoints with path parameters
curl -s https://target-api.example.com/api/docs/swagger.json | \
python3 -c "
import json, sys
spec = json.load(sys.stdin)
for path, methods in spec.get('paths', {}).items():
for method, details in methods.items():
if method in ('get','post','put','patch','delete'):
params = [p['name'] for p in details.get('parameters',[]) if p.get('in') in ('path','query')]
if params:
print(f'{method.upper()} {path} -> params: {params}')
"
From Burp Suite Traffic:
- Browse the application as User A, exercising all features that involve data creation and retrieval
- In Burp, go to Target > Site Map and filter for API paths (e.g.,
/api/v1/,/graphql) - Look for patterns:
/api/v1/users/{id},/api/v1/orders/{order_id},/api/v1/documents/{doc_uuid} - Note the object ID format: sequential integers (predictable), UUIDs (less predictable), or encoded values
Classify Object ID Types:
| ID Type | Example | Predictability | BOLA Risk |
|---|---|---|---|
| Sequential Integer | /orders/1042 |
High - increment/decrement | Critical |
| UUID v4 | /orders/550e8400-e29b-41d4-a716-446655440000 |
Low - random | Medium (if leaked) |
| Encoded/Hashed | /orders/base64encodedvalue |
Medium - decode and predict | High |
| Composite | /users/42/orders/1042 |
High - multiple IDs to swap | Critical |
| Slug | /profiles/john-doe |
Medium - guess usernames | High |
Step 2: Baseline Request Capture with Authenticated User
Capture legitimate requests for User A and User B:
import requests
BASE_URL = "https://target-api.example.com/api/v1"
# User A credentials
user_a_token = "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
user_a_headers = {"Authorization": user_a_token, "Content-Type": "application/json"}
# User B credentials
user_b_token = "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
user_b_headers = {"Authorization": user_b_token, "Content-Type": "application/json"}
# Step 1: Identify User A's objects
user_a_profile = requests.get(f"{BASE_URL}/users/me", headers=user_a_headers)
user_a_id = user_a_profile.json()["id"] # e.g., 1001
user_a_orders = requests.get(f"{BASE_URL}/users/{user_a_id}/orders", headers=user_a_headers)
user_a_order_ids = [o["id"] for o in user_a_orders.json()["orders"]] # e.g., [5001, 5002]
# Step 2: Identify User B's objects
user_b_profile = requests.get(f"{BASE_URL}/users/me", headers=user_b_headers)
user_b_id = user_b_profile.json()["id"] # e.g., 1002
user_b_orders = requests.get(f"{BASE_URL}/users/{user_b_id}/orders", headers=user_b_headers)
user_b_order_ids = [o["id"] for o in user_b_orders.json()["orders"]] # e.g., [5003, 5004]
print(f"User A (ID: {user_a_id}): Orders {user_a_order_ids}")
…
FAQ
What is BOLA/IDOR?
These are security flaws where a user can access or modify data they shouldn't, usually by swapping one identifier (ID) for another.
Do I need permission to use this tool?
Yes, it is essential to have explicit written authorization from the system owner before performing any tests.
What tools do I need to use?
You will need tools like Burp Suite or OWASP ZAP, test accounts, and basic programming knowledge.
Details
Original description by the author
Tests REST and GraphQL APIs for Broken Object Level Authorization (BOLA/IDOR, OWASP API1:2023) by intercepting API calls, identifying object ID parameters (numeric IDs, UUIDs, slugs), and systematically substituting IDs belonging to other users to check whether the server enforces per-object authorization. Use when asked to test BOLA or IDOR in an API, verify object-level authorization, or assess
Popularity
- GitHub stars
- 35k
- Ranking position
- #6215
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC