api-security-testing

Use when testing REST, GraphQL, gRPC, or WebSocket APIs against the OWASP API Security Top 10 — object- and function-level authorization (BOLA/BFLA), excessive data exposure, mass assignment, unrestricted resource consumption, and GraphQL-specific abuse. For apps you own or are authorized to test.

mn-youssef/security-skills31 installsMITSynced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: api-security-testing
description: Use when testing REST, GraphQL, gRPC, or WebSocket APIs against the OWASP API Security Top 10 — object- and function-level authorization (BOLA/BFLA), excessive data exposure, mass assignment, unrestricted resource consumption, and GraphQL-specific abuse. For apps you own or are authorized to test.
license: MIT
---

# API Security Testing (FIND/EXPLOIT — OWASP API Top 10)

## Overview
Modern apps are API-first, and APIs fail differently from web pages: the bugs are in
*authorization per object/field* and *resource limits*, not rendering. Test the API directly,
bypassing the UI entirely.

**Core principle:** The UI is one client; attackers talk to the API raw. Every endpoint, field,
and method must enforce authz and limits on its own — the front-end protects nothing.

## Applies when / Skip when
- **Applies when:** the app exposes a programmatic API — REST, GraphQL, gRPC, or WebSocket —
  including the API *behind* a SPA or mobile client.
- **Skip when:** the app is purely server-rendered HTML with no API anyone calls → N/A.
- **If N/A:** report "api-security-testing: N/A — no API surface" and stop.

## ⚠️ Authorization
Your own/authorized API. Use test accounts and a non-production instance for stateful tests.

## Get the spec first
Pull the contract, then test every operation it (and the UI) reveals:
- OpenAPI/Swagger (`/swagger`, `/openapi.json`, `/api-docs`), GraphQL **introspection**,
  gRPC reflection, Postman collections, mobile-app traffic via proxy.
- Diff documented endpoints vs. what the app actually calls — **undocumented endpoints** are gold.

## OWASP API Top 10 — the checklist
| # | Risk | Test |
|---|------|------|
| API1 | **BOLA** (object authz) | Swap object ids across accounts → see `access-control-testing` |
| API2 | Broken authentication | Weak tokens/JWT/keys → see `authentication-testing` |
| API3 | **BOPLA** (property authz) | Read fields you shouldn't (excessive exposure) / write fields you shouldn't (mass assignment) |
| API4 | Unrestricted resource consumption | No rate/size/page limits; expensive queries; cost/DoS |
| API5 | **BFLA** (function authz) | Call admin/privileged operations as a normal user |
| API6 | Unrestricted access to business flows | Automate a flow meant to be human-paced (scalping, spam) |
| API7 | SSRF | Server fetches a URL you supply → see `file-upload-and-ssrf` |
| API8 | Misconfiguration | Verbose errors, permissive CORS, missing security headers |
| API9 | Improper inventory | Old `/v1` next to `/v2`, staging APIs, undocumented endpoints |
| API10 | Unsafe third-party consumption | App trusts an external API's response blindly |

See `references/api-attacks.md` for REST, GraphQL, gRPC, and WebSocket recipes.

## Excessive data exposure vs. the UI
The API often returns more than the UI shows (full user objects with `passwordHash`, internal
flags, other users' fields). **Inspect raw JSON responses**, not the rendered page.

## GraphQL specifics (high-value)
- **Introspection** enabled → full schema map. Pull it.
- **Batching / aliasing** → bypass rate limits, brute-force via one request.
- **Query depth/complexity** → nested recursive queries for DoS.
- **Field-level authz** → a field guarded in one query exposed via another path/mutation.

## Output
Per finding: endpoint/operation, method, account used, the raw request/response, which API-Top-10
class, and impact. BOLA/BFLA findings are typically High–Critical.

## Hand-off
Deep authz → **`access-control-testing`**; auth/JWT → **`authentication-testing`**; flow abuse →
**`business-logic-testing`**; reproduce → **`active-pentest`**; fix → **`security-hardening`**.

## Common mistakes
- Testing through the UI only — hit the API directly; that's the real attack surface.
- Reading the rendered page instead of the raw JSON — that's where over-exposure hides.
- Forgetting GraphQL introspection/batching and gRPC reflection — they hand you the whole map.
- Ignoring old API versions — `/v1` often lacks `/v2`'s fixes.

More Security skills

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

318.9k

azure-messaging

microsoft/azure-skills

Troubleshoot and resolve issues with Azure Messaging SDKs for Event Hubs and Service Bus. Covers connection failures, authentication errors, message processing issues, and SDK configuration problems. WHEN: event hub SDK error, service bus SDK issue, messaging connection failure, AMQP error, event processor host issue, message lock lost, message lock expired, lock renewal, lock renewal batch, send timeout, receiver disconnected, SDK troubleshooting, azure messaging SDK, event hub consumer, service bus queue issue, topic subscription error, enable logging event hub, service bus logging, eventhub python, servicebus java, eventhub javascript, servicebus dotnet, event hub checkpoint, event hub not receiving messages, service bus dead letter, batch processing lock, session lock expired, idle timeout, connection inactive, link detach, slow reconnect, session error, duplicate events, offset reset, receive batch.

310.3k

azure-compliance

microsoft/azure-skills

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

293.2k

← All Security skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY