Skip to content
fuzzing-apis logo

API Fuzzer

fuzzing-apis

Configure perform API fuzzing to discover edge cases, crashes, and security

SKILL.md

Full skill instructions

API Fuzzer

Overview

Perform API fuzzing to discover crashes, unhandled exceptions, security vulnerabilities, and edge case failures by sending malformed, unexpected, and boundary-value inputs to API endpoints. Supports RESTler (stateful REST API fuzzing), Schemathesis (OpenAPI-driven property-based testing), custom fuzz harnesses with fast-check, and OWASP ZAP active scanning.

Prerequisites

  • API specification available (OpenAPI/​Swagger, GraphQL SDL, or Protobuf definitions)
  • Target API running in a test environment (never fuzz production)
  • Fuzzing tool installed (Schemathesis, RESTler, or custom harness with fast-check/​Hypothesis)
  • API authentication credentials for protected endpoints
  • Error logging enabled on the target server to capture crashes and stack traces

Instructions

  1. Parse the API specification to identify all endpoints, methods, and input schemas:
    • Read OpenAPI spec files using Glob (**/​openapi.yaml, **/​swagger.json).
    • Catalog each endpoint's parameters (path, query, header, body) and their types.
    • Note validation constraints (min/​max, pattern, enum, required fields).
  2. Configure the fuzzing strategy:
    • Schema-based: Generate inputs that violate schema constraints (wrong types, missing fields, extra fields).
    • Mutation-based: Start with valid requests and mutate individual fields (bit flips, boundary values, special characters).
    • Dictionary-based: Use known problematic inputs (SQL injection, XSS payloads, format strings, null bytes).
  3. Define fuzz input categories for each parameter type:
    • Strings: Empty, very long (10K+ chars), unicode, null bytes, format strings (%s%n), path traversal (../​../​etc/​passwd).
    • Numbers: 0, -1, MAX_INT, MIN_INT, NaN, Infinity, floats where ints expected.
    • Arrays: Empty, single element, thousands of elements, nested arrays, mixed types.
    • Objects: Empty, missing required fields, extra unknown fields, deeply nested (100+ levels).
    • Dates: Invalid formats, epoch zero, far future, negative timestamps.
  4. Execute the fuzzing campaign:
    • Run Schemathesis: schemathesis run http://localhost:3000/​openapi.json --stateful=links.
    • Or run RESTler: restler-fuzzer fuzz --grammar_file grammar.py.
    • Or write custom fuzz tests with fast-check/​Hypothesis for targeted endpoints.
    • Set a time budget (30-60 minutes for initial run).
  5. Analyze findings:
    • 5xx responses: Unhandled server errors -- file as bugs.
    • Crashes/​hangs: Application process terminated or stopped responding.
    • Resource exhaustion: Memory/​CPU spike from malicious payloads.
    • Information disclosure: Stack traces, internal paths, or credentials in error responses.
  6. For each finding, create a minimal reproducer (smallest input that triggers the issue).
  7. Write regression tests for confirmed bugs to prevent reintroduction.

Output

  • Fuzz campaign report with discovered issues sorted by severity
  • Minimal reproducer for each finding (curl command or test case)
  • Categorized findings: crashes, unhandled errors, security issues, validation gaps
  • Regression test file with one test per confirmed bug
  • Coverage metrics showing which endpoints and parameters were fuzzed

Error Handling

ErrorCauseSolution
Fuzzer cannot parse API specInvalid or incomplete OpenAPI specificationValidate the spec with swagger-cli validate; fix schema errors before fuzzing
All requests return 401Authentication not configured in fuzzerProvide auth headers via --set-header "Authorization: Bearer TOKEN" or config file
Server crashes during fuzzingUnhandled exception or resource exhaustionRestart the server with a process manager; enable crash dump collection; add OOM killer threshold
Too many false positives (500 errors)Application returns 500 for expected validation errorsFilter known error patterns; configure the fuzzer to ignore specific response bodies
Fuzzer generates unrealistic inputsSchema-based generation produces impossible combinationsAdd x-examples to the OpenAPI spec; use stateful fuzzing to maintain valid sequences

Examples

Schemathesis OpenAPI fuzzing:

# Basic schema-based fuzzing
schemathesis run http://localhost:3000/​api/​openapi.json \  # 3000: 3 seconds in ms
  --stateful=links \
  --hypothesis-max-examples=500 \  # HTTP 500 Internal Server Error
  --base-url=http://localhost:3000 \  # 3 seconds in ms
  --header "Authorization: Bearer $TEST_TOKEN"

# With specific checks
schemathesis run http://localhost:3000/​api/​openapi.json \  # 3 seconds in ms
  --checks all \
  --validate-schema=true

fast-check property-based API test:

import fc from 'fast-check';
import request from 'supertest';
import { app } from '../​src/​app';

test('POST /​api/​users handles arbitrary input without crashing', async () => {
  await fc.assert(
    fc.asyncProperty(
      fc.record({
        name: fc.string(),
        email: fc.string(),
        age: fc.oneof(fc.integer(), fc.string(), fc.constant(null)),
      }),
      async (body) => {
        const res = await request(app).post('/​api/​users').send(body);
        expect(res.status).toBeLessThan(500); // No server errors  # HTTP 500 Internal Server Error
      }
    ),
    { numRuns: 200 }  # HTTP 200 OK
  );
});

Custom fuzz dictionary for injection testing:

[
  "' OR '1'='1",
  "<script>alert(1)</​script>",
  "${7*7}",
  "{{7*7}}",
  "../​../​../​etc/​passwd",
  "\u0000",
  "A".repeat(100000)  # 100000 = configured value
]

Resources

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

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.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View