Perform targeted security review of API endpoints. APIs present unique attack surface beyond standard web vulnerabilities: mass assignment, BOLA/BFLA, excessive data exposure, lack of rate limiting, and GraphQL-specific issues. This skill covers REST, GraphQL, WebSocket, and gRPC APIs.
-
Scope Verification — Confirm API target is within authorized scope.
-
API Discovery & Mapping — Enumerate:
- All endpoints (from docs, source code, or active discovery)
- HTTP methods per endpoint
- Request/response schemas
- Authentication requirements per endpoint
- Rate limiting configuration
- API versioning scheme
- For GraphQL: full schema introspection (queries, mutations, subscriptions, types)
-
OWASP API Security Top 10 (2023) Review:
API1: Broken Object-Level Authorization (BOLA)
- Test every endpoint that accepts object IDs
- Swap IDs between users: can user A access user B's objects?
- Test with sequential IDs, UUIDs, and encoded references
- Check bulk/list endpoints for data leakage
API2: Broken Authentication
- Test authentication on every endpoint (remove token, use expired token)
- Check for authentication bypass via parameter pollution
- Test token generation entropy and lifetime
- Verify logout actually invalidates tokens
API3: Broken Object Property Level Authorization
- Test mass assignment: send extra fields in create/update requests
- Check response filtering: does the API return more fields than needed?
- Test field-level access: can regular user see/modify admin-only fields?
API4: Unrestricted Resource Consumption
- Check rate limiting on all endpoints (especially auth, search, export)
- Test pagination limits (request page_size=999999)
- Check file upload size limits
- Test query complexity limits (GraphQL: deeply nested queries)
- Check for batch/bulk endpoints without limits
API5: Broken Function-Level Authorization (BFLA)
- Test admin endpoints with regular user tokens
- Check HTTP method restrictions (can regular user PUT/DELETE?)
- Test undocumented endpoints found during discovery
- Verify role-based access on every function
API6: Unrestricted Access to Sensitive Business Flows
- Identify valuable business flows (purchase, transfer, signup)
- Test for anti-automation controls
- Check for race conditions in critical flows
- Test business logic bypass (skip steps, negative values)
API7: Server-Side Request Forgery (SSRF)
- Test URL/webhook parameters for SSRF
- Check file import/fetch features
- Test with internal IPs, cloud metadata URLs
- Check for protocol restrictions
API8: Security Misconfiguration
- Check CORS on API endpoints
- Verify error responses don't leak internal details
- Check for exposed debug/health/metrics endpoints
- Review API gateway configuration
API9: Improper Inventory Management
- Identify old API versions still accessible
- Check for shadow/undocumented APIs
- Test deprecated endpoints for weaker security
- Map API vs documented API (find gaps)
API10: Unsafe Consumption of Third-Party APIs
- Identify outbound API calls in source code
- Check if responses from third-party APIs are validated
- Verify TLS on outbound connections
- Check for SSRF via third-party URL construction
-
GraphQL-Specific Testing (if applicable):
- Introspection query enabled? (
__schema, __type)
- Query depth limiting (deeply nested query bomb)
- Query complexity/cost analysis
- Batch query abuse
- Field suggestions leaking schema info
- Mutation authorization (field-level)
- Subscription authorization
- Alias-based rate limit bypass
-
WebSocket-Specific Testing (if applicable):
- Authentication during handshake vs per-message
- Authorization on each message type
- Input validation on WebSocket messages
- Cross-Site WebSocket Hijacking (CSWSH)
- Message injection
- Origin validation
-
Input Validation Testing — On each endpoint:
- SQL/NoSQL injection in query parameters and body
- Command injection in processing parameters
- XSS in reflected API responses
- XML/JSON injection in structured inputs
- Path traversal in file-related parameters
- Type confusion (string where int expected, array where string expected)
-
LLM/AI API Security Testing (when endpoint is an AI API or wraps an AI provider):
Authentication & Authorization:
Prompt Injection via API:
Insecure Output Handling:
Streaming Endpoints (SSE / WebSocket):
Rate Limiting & Resource Consumption:
AI Plugin / Function-Calling APIs (if exposed):
If LLM/AI is the primary subject: invoke llm-and-ai-security/SKILL.md for full assessment.
-
Webhook Security Testing (if webhooks are in scope or delivered to attacker-controlled endpoints):
Signature Validation:
Replay Attack via Timestamp Bypass:
Retry Logic Abuse (Idempotency Bypass):
SSRF via Webhook Callback URL:
Transport Security:
-
Classify & Route — Per severity-matrix.md, route to bug-bounty-triage