API Security Testing
by Mr Vempire
Audit REST and GraphQL APIs against the OWASP API Security Top 10 with a structured test matrix and automated test generation.
$12
API Security Testing
Example session with this skill installed
I need to test my order management API. I have the OpenAPI spec and two test accounts: a standard customer and a warehouse manager. Map the surface and check for BOLA on the order ID.
- Read your context and instructions
- Compiled the api security testing
I have mapped the API surface from the provided OpenAPI spec and initialized the security test matrix. Below is the assessment of the GET /api/v1/orders/{orderId} and PATCH /api/v1/orders/{orderId} endpoints focusing on Broken Object-Level Authorization (BOLA).
API Security Test Matrix (BOLA Focus)
| Endpoint | Method | Role | Payload Location | Finding | Evidence |
|---|---|---|---|---|---|
/api/v1/orders/{id} | GET | Customer B | Path | VULNERABLE | Requested ID ORD-99 (User A) -> 200 OK |
/api/v1/orders/{id} | GET | Customer B | Query | PASS | ?id=ORD-99 -> 404 Not Found |
/api/v1/orders/{id} | PATCH | Customer B | Body | VULNERABLE | Sent {"status":"SHIPPED"} for ORD-99 -> 200 OK |
/api/v1/orders/{id} | DELETE | Customer B | Path | PASS | Requested ID ORD-99 -> 403 Forbidden |
Executable Test Cases (bola_checks.py)
import requests
# Test: API1 - BOLA on Order Retrieval
# Target: GET /api/v1/orders/{orderId}
def test_bola_path_parameter(base_url, attacker_token, victim_order_id):
headers = {"Authorization": f"Bearer {attacker_token}"}
url = f"{base_url}/api/v1/orders/{victim_order_id}"
response = requests.get(url, headers=headers)
if response.status_code == 200:
print(f"[!] BOLA Detected: Customer can access Order {victim_order_id}")
else:
print(f"[+] Secure: Received {response.status_code}")
# Test: API3 - Mass Assignment on Order Status
def test_mass_assignment(base_url, customer_token, order_id):
headers = {"Authorization": f"Bearer {customer_token}"}
payload = {"id": order_id, "status": "DELIVERED", "internal_notes": "hacked"}
url = f"{base_url}/api/v1/orders/{order_id}"
response = requests.patch(url, json=payload, headers=headers)
if response.json().get("internal_notes") == "hacked":
print("[!] Mass Assignment: Internal fields updated via API")
Next steps
- Implement object-level ownership checks in the Order controller to ensure
auth.user_id == order.owner_id. - Disable the
PATCHmethod for standard customers on the orders endpoint. - Apply a DTO (Data Transfer Object) or allow-list to the update endpoint to prevent mass assignment of internal fields.
Connects securely to your tools. The creator never sees your data.
About this skill
Securing APIs requires more than just checking for a valid token. Most vulnerabilities live in the business logic where authorization checks are missing, allowing attackers to access other users' data or admin functions. This skill provides a systematic methodology to audit REST and GraphQL APIs against the OWASP API Security Top 10.
What it does
- Surface Mapping Identifies documented and hidden endpoints, including legacy versions and debug routes.
- BOLA Testing Probes for Broken Object-Level Authorization by manipulating IDs in paths, queries, and request bodies.
- BFLA Validation Executes Broken Function-Level Authorization checks by calling admin-only endpoints with low-privilege tokens.
- Data Exposure Audit Detects excessive data exposure and mass assignment vulnerabilities in update requests.
- Resource Limiting Tests for unrestricted resource consumption through rate limit bypasses and pagination abuse.
- GraphQL Analysis Evaluates schema introspection, query depth, and batching vulnerabilities specific to GraphQL resolvers.
How it works
- Map the surface by collecting endpoints from OpenAPI specs, network traffic, and client-side JavaScript bundles.
- Build a test matrix that maps every endpoint against every available user role and privilege level.
- Execute the playbook across all nine modules, from authentication bypasses to business-flow logic flaws.
- Generate test cases using
openapi-testgen.pyto create executable checks for BOLA and rate limiting.
Frameworks & tools
This skill is designed for testing REST and GraphQL APIs. It utilizes openapi-testgen.py for automated test generation and works alongside intercepting proxies like Burp Suite or OWASP ZAP, and REST clients like curl.
Why this beats prompting it yourself
Generic security prompts often miss the nuance of testing the same ID in three different locations or checking for undocumented /v2/ routes. This skill enforces a rigid matrix-based approach that ensures every role-endpoint combination is actually verified with evidence.
Use cases
- Auditing a new API version before it moves to production.
- Identifying authorization gaps during a bug bounty engagement.
- Verifying that front-end restrictions are actually enforced by the backend.
- Benchmarking internal APIs against the 2023 OWASP API Security Top 10.
Known limitations
Requires pre-existing API documentation or captured network traffic to map the surface. Only generates executable tests if a valid OpenAPI spec is provided.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Permissions
Allowed Hosts
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.