API Attack Surface Mapper
When To Use
Use this skill when you need high coverage before exploitation.
When Not To Use
Do not use this as a replacement for exploit confirmation. It is a discovery and planning skill.
Required Inputs
target_base_url
api_spec_source (OpenAPI URL/file, Postman collection, or captured traffic)
auth_context (token types, role accounts, session rules)
scope_rules (in-scope services, forbidden actions)
Optional Inputs
known_business_flows
environment_limits (rate limits, test windows)
seed_ids (known object identifiers)
Preflight Checklist
Execution Workflow
Phase 1: Normalize Inputs
- Parse spec and resolve path templates, tags, and schema references.
- Deduplicate routes by method + canonical path.
- Flag undocumented endpoints observed in traffic.
Phase 2: Build Trust-Boundary Map
- Label endpoints as
public, user, admin, internal, or unknown.
- Map auth styles: cookie session, bearer token, API key, mTLS.
- Capture identity source and role enforcement points.
Phase 3: Parameter Risk Profiling
- Classify parameters by risk type:
- object references
- filter/sort/query operators
- file/blob inputs
- callback URLs
- rich text/template fields
- Mark whether each parameter is attacker-controlled and persisted.
Phase 4: Test Matrix Generation
- Generate baseline tests for each endpoint (auth, method, content type).
- Generate abuse tests by class:
- BOLA/BFLA
- mass assignment
- injection
- SSRF-style URL handling
- workflow/state abuse
- Prioritize by business impact and reachable privilege.
Phase 5: Low-Noise Validation
- Confirm route liveness and auth expectations.
- Record response fingerprint per endpoint:
- status bands
- auth error shape
- validation error shape
- Mark unstable endpoints as low-confidence until retested.
Coverage Matrix (Minimum)
| Class |
Minimum Check |
| BOLA/BFLA |
Cross-account object access with role switch |
| Auth/session |
Missing token, expired token, token audience mismatch |
| Mass assignment |
Hidden fields on create/update |
| Injection |
SQL/NoSQL/template/operator contexts |
| SSRF |
URL/file fetchers, webhooks, importers |
| Data exposure |
Over-broad response fields and debug traces |
| Rate abuse |
Lack of throttling on sensitive actions |
| Workflow abuse |
Invalid state transitions, skipped approvals |
Evidence Requirements
- Endpoint inventory with method/path/auth labels.
- Request templates for each high-priority case.
- Response fingerprints for baseline and negative controls.
- Explicit unknowns and blockers.
Output Contract
Return JSON:
{
"endpoint_inventory": [],
"trust_boundaries": [],
"parameter_risk_profile": [],
"prioritized_test_matrix": [],
"baseline_observations": [],
"coverage_gaps": []
}
Failure Modes
- Treating spec as truth while ignoring runtime drift.
- Assuming role checks from docs instead of testing.
- Ignoring undocumented routes from front-end telemetry.
Exit Criteria
- Inventory covers all observed and documented routes.
- Each high-risk endpoint has at least one concrete test case.
- Unknowns are explicit and actionable.
Detailed Operator Notes
Endpoint Normalization Rules
- Normalize path params to
{id} style for deduping.
- Split endpoints by functional domain before prioritization.
- Keep undocumented and documented routes as separate sources.
Prioritization Heuristics
- Highest priority: object-level operations with write capability.
- Next priority: admin-like routes exposed in user-auth context.
- Next priority: import/export and callback endpoints.
- Lower priority: purely informational static metadata routes.
Common Blind Spots
- Versioned paths that differ only by prefix behavior.
- Bulk endpoints with relaxed validation compared to single-item routes.
- Graph-like query parameters that reach data-layer operators.
Reporting Rules
- Include
discovery_source per endpoint (spec, traffic, frontend).
- Include
auth_assumption and auth_verified flags separately.
- Include
priority_reason for every high-risk endpoint.
Conditional Decision Matrix
| Condition |
Action |
Evidence Requirement |
| Endpoint undocumented but reachable |
Add to inventory and prioritize authz checks |
request/response baseline + auth behavior |
| Auth behavior inconsistent across methods |
Split tests by method and content type |
per-method status + body signatures |
| Time-based anomaly only |
run matched control timing series |
repeated control/test timing traces |
| Object access differs by role |
escalate to cross-tenant/cross-role checks |
role-tagged replay proof |
| Validation differs by parser |
run semantic-equivalent content-type tests |
parser-path differential evidence |
Advanced Coverage Extensions
- Add negative-object tests for soft-deleted or archived resources.
- Add replay-window tests for idempotency and duplicate processing.
- Add bulk endpoint abuse tests for partial authorization failures.
- Add asynchronous job handoff checks for stale permission snapshots.
- Add pagination/filter abuse checks for hidden data exposure.
1---2name: api-attack-surface-mapper3description: Build a full API inventory, trust-boundary map, and prioritized test matrix from specification and observed behavior.4---56# API Attack Surface Mapper78## When To Use9Use this skill when you need high coverage before exploitation.1011## When Not To Use12Do not use this as a replacement for exploit confirmation. It is a discovery and planning skill.1314## Required Inputs15- `target_base_url`16- `api_spec_source` (OpenAPI URL/file, Postman collection, or captured traffic)17- `auth_context` (token types, role accounts, session rules)18- `scope_rules` (in-scope services, forbidden actions)1920## Optional Inputs21- `known_business_flows`22- `environment_limits` (rate limits, test windows)23- `seed_ids` (known object identifiers)2425## Preflight Checklist26- [ ] Spec is reachable and parseable.27- [ ] Base URL and version path are confirmed.28- [ ] Auth mechanism is known per endpoint family.29- [ ] Scope exclusions are explicit.3031## Execution Workflow32### Phase 1: Normalize Inputs331. Parse spec and resolve path templates, tags, and schema references.342. Deduplicate routes by method + canonical path.353. Flag undocumented endpoints observed in traffic.3637### Phase 2: Build Trust-Boundary Map381. Label endpoints as `public`, `user`, `admin`, `internal`, or `unknown`.392. Map auth styles: cookie session, bearer token, API key, mTLS.403. Capture identity source and role enforcement points.4142### Phase 3: Parameter Risk Profiling431. Classify parameters by risk type:44- object references45- filter/sort/query operators46- file/blob inputs47- callback URLs48- rich text/template fields492. Mark whether each parameter is attacker-controlled and persisted.5051### Phase 4: Test Matrix Generation521. Generate baseline tests for each endpoint (auth, method, content type).532. Generate abuse tests by class:54- BOLA/BFLA55- mass assignment56- injection57- SSRF-style URL handling58- workflow/state abuse593. Prioritize by business impact and reachable privilege.6061### Phase 5: Low-Noise Validation621. Confirm route liveness and auth expectations.632. Record response fingerprint per endpoint:64- status bands65- auth error shape66- validation error shape673. Mark unstable endpoints as low-confidence until retested.6869## Coverage Matrix (Minimum)70| Class | Minimum Check |71|---|---|72| BOLA/BFLA | Cross-account object access with role switch |73| Auth/session | Missing token, expired token, token audience mismatch |74| Mass assignment | Hidden fields on create/update |75| Injection | SQL/NoSQL/template/operator contexts |76| SSRF | URL/file fetchers, webhooks, importers |77| Data exposure | Over-broad response fields and debug traces |78| Rate abuse | Lack of throttling on sensitive actions |79| Workflow abuse | Invalid state transitions, skipped approvals |8081## Evidence Requirements82- Endpoint inventory with method/path/auth labels.83- Request templates for each high-priority case.84- Response fingerprints for baseline and negative controls.85- Explicit unknowns and blockers.8687## Output Contract88Return JSON:89```json90{91 "endpoint_inventory": [],92 "trust_boundaries": [],93 "parameter_risk_profile": [],94 "prioritized_test_matrix": [],95 "baseline_observations": [],96 "coverage_gaps": []97}98```99100## Failure Modes101- Treating spec as truth while ignoring runtime drift.102- Assuming role checks from docs instead of testing.103- Ignoring undocumented routes from front-end telemetry.104105## Exit Criteria106- Inventory covers all observed and documented routes.107- Each high-risk endpoint has at least one concrete test case.108- Unknowns are explicit and actionable.109110## Detailed Operator Notes111### Endpoint Normalization Rules112- Normalize path params to `{id}` style for deduping.113- Split endpoints by functional domain before prioritization.114- Keep undocumented and documented routes as separate sources.115116### Prioritization Heuristics117- Highest priority: object-level operations with write capability.118- Next priority: admin-like routes exposed in user-auth context.119- Next priority: import/export and callback endpoints.120- Lower priority: purely informational static metadata routes.121122### Common Blind Spots123- Versioned paths that differ only by prefix behavior.124- Bulk endpoints with relaxed validation compared to single-item routes.125- Graph-like query parameters that reach data-layer operators.126127### Reporting Rules128- Include `discovery_source` per endpoint (`spec`, `traffic`, `frontend`).129- Include `auth_assumption` and `auth_verified` flags separately.130- Include `priority_reason` for every high-risk endpoint.131132## Conditional Decision Matrix133| Condition | Action | Evidence Requirement |134|---|---|---|135| Endpoint undocumented but reachable | Add to inventory and prioritize authz checks | request/response baseline + auth behavior |136| Auth behavior inconsistent across methods | Split tests by method and content type | per-method status + body signatures |137| Time-based anomaly only | run matched control timing series | repeated control/test timing traces |138| Object access differs by role | escalate to cross-tenant/cross-role checks | role-tagged replay proof |139| Validation differs by parser | run semantic-equivalent content-type tests | parser-path differential evidence |140141## Advanced Coverage Extensions1421. Add negative-object tests for soft-deleted or archived resources.1432. Add replay-window tests for idempotency and duplicate processing.1443. Add bulk endpoint abuse tests for partial authorization failures.1454. Add asynchronous job handoff checks for stale permission snapshots.1465. Add pagination/filter abuse checks for hidden data exposure.