mcpField
A
api-security-testing

api-security-testing

github.com/mn-youssefSecurity4993 installsUpdated 20w ago
Repository

About api-security-testing

An API security testing skill for assessing REST, GraphQL, gRPC, and WebSocket surfaces against the OWASP API Top 10. It emphasizes direct API requests, authorization checks, resource limits, and reporting reproducible evidence.

Key features

  1. 01Tests APIs against OWASP API Top 10
  2. 02Uses API specifications to map operations
  3. 03Checks object, field, and function authorization
  4. 04Tests rate, size, and query limits
  5. 05Inspects raw responses for excess data
  6. 06Records request, response, and impact

Use cases

  1. 01Assess authorization across user accounts
  2. 02Check GraphQL introspection and query limits
  3. 03Find undocumented or outdated API endpoints
  4. 04Inspect API responses for exposed fields

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mn-youssef/security-skills --skill api-security-testing

After installing, type/api-security-testingin Claude Code to confirm it loaded.

Bundled filesreferences/api-attacks.md

Details

From the project README

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

#RiskTest
API1BOLA (object authz)Swap object ids across accounts → see access-control-testing
API2Broken authenticationWeak tokens/JWT/keys → see authentication-testing
API3BOPLA (property authz)Read fields you shouldn't (excessive exposure) / write fields you shouldn't (mass assignment)
API4Unrestricted resource consumptionNo rate/size/page limits; expensive queries; cost/DoS
API5BFLA (function authz)Call admin/privileged operations as a normal user
API6Unrestricted access to business flowsAutomate a flow meant to be human-paced (scalping, spam)
API7SSRFServer fetches a URL you supply → see file-upload-and-ssrf
API8MisconfigurationVerbose errors, permissive CORS, missing security headers
API9Improper inventoryOld /v1 next to /v2, staging APIs, undocumented endpoints
API10Unsafe third-party consumptionApp 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.

Comments

Markdown supported