testing-api-for-broken-object-level-authorization
Qué hace
Esta herramienta comprueba si un sistema en línea (API) permite que un usuario acceda o modifique los datos de otro usuario sin permiso. Lo hace probando distintos identificadores de objetos.
Cuándo usarla
- ✓Cuando pruebas la seguridad de un sistema en línea.
- ✓Cuando quieres asegurarte de que los usuarios no pueden acceder a los datos de otros.
- ✓Cuando verificas si el sistema protege correctamente los datos de cada persona.
Link de la skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-api-for-broken-object-level-authorization/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Comprueba si la API permite que el usuario A vea los pedidos del usuario B.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La herramienta intenta usar el identificador de un objeto (como un número de pedido) que pertenece a un usuario, pero con las credenciales de otro. Si se concede el acceso, el sistema tiene un fallo de seguridad.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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}")
…
Preguntas frecuentes
¿Qué son BOLA e IDOR?
Son fallos de seguridad en los que un usuario puede acceder o modificar datos que no le corresponden, normalmente cambiando un identificador (ID) por otro.
¿Necesito permiso para usar esta herramienta?
Sí, es imprescindible tener una autorización explícita y por escrito del propietario del sistema antes de hacer cualquier prueba.
¿Qué herramientas necesito?
Necesitas herramientas como Burp Suite u OWASP ZAP, cuentas de prueba y conocimientos básicos de programación.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 35 mil
- Posición en el ranking
- #8378
- Licencia
- Apache-2.0
- Actualizada
- 31/8/2026
Comentarios
- …
Más skills de este repositorio
abusing-dpapi-for-credential-access
35 milDa a tu agente de IA instrucciones listas para una tarea específica, para que la haga mejor y más rápido.
abusing-shadow-credentials-for-privesc
35 milEnseña a tu agente de IA a escribir textos claros y bien estructurados.
achieving-cmmc-level-2-compliance
35 milAyuda a tu agente a preparar un entorno para el cumplimiento de CMMC Nivel 2. Implementa los requisitos de seguridad y gestiona la documentación necesaria.
acquiring-disk-image-with-dd-and-dcfldd
35 milAyuda a tu agente a crear copias exactas de discos duros. Es útil para asegurar que no se pierda ni altere información durante las investigaciones.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.