hunt-fastapi

hunt-fastapi is a skill for Claude Code, Codex from uphiago/recon-skills. It costs 26 tokens per session (1,809 once invoked), scanned A, original, MIT.

A security-hunting guide for FastAPI, a Python framework for building web APIs. It focuses on authorization gaps, input validation problems, hidden endpoints, and middleware bypasses.

In plain words
What is it for?
Use it to inspect FastAPI APIs, mine OpenAPI schemas for endpoints, test authorization dependencies and model coercion, and check REST, WebSocket, and middleware behavior.
Why use it?
It helps find vulnerabilities that arise from FastAPI’s dependency injection, Pydantic validation, automatically generated API documentation, and ASGI middleware.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect FastAPI APIs, mine OpenAPI schemas for endpoints, test…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/uphiago/recon-skills/hunt-fastapi
About the project

Recon Skills is a pack of security-testing skills covering reconnaissance, web applications, APIs, authentication, vulnerability validation, cloud infrastructure, and reporting. Security professionals use it for authorized assessments of systems they own or have written permission to test. The catalogue entries are individual skills from the pack.

uphiago/recon-skills · 1,242 stars · on GitHub · hiago.sh

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add uphiago/recon-skills --skill hunt-fastapi
Clone the repo
git clone --depth 1 https://github.com/uphiago/recon-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hunt-fastapi

README.md
[![agentmods](https://agentmods.dev/badge/skills/uphiago/recon-skills/hunt-fastapi.svg)](https://agentmods.dev/skills/uphiago/recon-skills/hunt-fastapi)
Your own site
<a href="https://agentmods.dev/skills/uphiago/recon-skills/hunt-fastapi"><img src="https://agentmods.dev/badge/skills/uphiago/recon-skills/hunt-fastapi.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,809 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.01809
Opus 5 $0.00013 $0.00905
Sonnet 5 $0.00005 $0.00362
Haiku 4.5 $0.00003 $0.00181

Measured 3d ago against content hash 79d7718194f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

hunt-fastapi scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

compatibility: Requires curl, python3
redteam/hunt-fastapi/SKILL.md · 163 lines

How it starts

The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FastAPI Security Hunting

Hunt FastAPI-specific vulnerabilities in dependency injection authorization gaps, Pydantic model coercion and extra field exploitation, OpenAPI schema mining for hidden endpoints, and ASGI middleware bypasses. FastAPI's design — dependency injection for auth, Pydantic for validation, OpenAPI auto-generation — creates unique attack surface distinct from Flask or Django.

When to Use

  • Target uses FastAPI (indicated by /docs, /redoc, /openapi.json, or server: uvicorn).
  • OpenAPI schema is publicly accessible.
  • API uses dependency injection (Depends) for authorization.
  • WebSocket endpoints exist alongside REST API.
  • Application uses Pydantic v1 or v2 for request validation.

Quick Detection

# FastAPI fingerprinting
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/openapi.json" | jq '.info.title' 2>/dev/null
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/docs" -w "%{http_code}\n" -o /dev/null
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/redoc" -w "%{http_code}\n" -o /dev/null

Procedure

Phase 1 — OpenAPI Schema Mining

# Download full schema for endpoint discovery
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/openapi.json" | jq '.paths | keys[]'

# Find hidden endpoints not in docs
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/openapi.json" | jq '.paths | to_entries[] | select(.value.get != null and .value.get.security == []) | .key'

# Discover internal endpoints via path parameter fuzzing
ffuf -u "https://target.com/api/FUZZ" \
  -w /path/to/wordlist.txt \
  -mc 200,401,403 \
  -H "Accept: application/json"

Phase 2 — Dependency Injection Authorization Gaps

# Depends vs Security — check if auth is actually enforced
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/admin/users"     # no auth
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/admin/users" \
  -H "Authorization: Bearer INVALID_TOKEN"         # invalid auth

# Dependency override in path operations
# Some endpoints may inherit Depends from router but override with None
for method in GET POST PUT PATCH DELETE; do
  curl --max-time 30 --connect-timeout 10 -sk -X "$method" "https://target.com/api/users/1" \
    -w "$method — %{http_code}\n" -o /dev/null
done

# Background tasks added via BackgroundTasks may skip auth
curl --max-time 30 --connect-timeout 10 -sk -X POST "https://target.com/api/orders" \
  -H "Content-Type: application/json" \
  -d '{"user_id":"VICTIM_ID","product":"test"}'

Read the full file on GitHub · 163 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 163 lines · 26 tokens per session scan A 79d7718194f3

Subscribe to this mod's changes

hunt-fastapi is a skill published in the GitHub repository uphiago/recon-skills (1,242 stars, last pushed 5d ago), licensed MIT. It adds 26 tokens to every session and 1,809 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

fastapi-docs

FastAPI 0.115+ — path/query params, Pydantic, dependency injection, OAuth2/JWT, middleware, WebSocket, testing.

pledgeandgrow/pledge-skills · 36 tokens

datamodel-code-generator

Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…

koxudaxi/datamodel-code-generator · 147 tokens

fastapi-expert

Expert-level FastAPI development for high-performance Python APIs with async support. Use when the user mentions Python, API, async, REST, OpenAPI, or Pydantic, or when the task involves FastAPI Features.

personamanagmentlayer/pcl · 49 tokens

fastapi

Operational skill for FastAPI: Pydantic models, dependency injection, async routes, OpenAPI, authentication hooks, and TestClient-based testing.

alivirgo/Major-AI-Skills · 32 tokens

FastAPI Modern Web Development

Production-grade FastAPI development with async patterns, Pydantic v2, dependency injection, ML/AI endpoint design, and modern Python best practices for building high-performance REST APIs.

bobmatnyc/mcp-skillset · 41 tokens

performing-api-fuzzing-with-restler

Uses Microsoft RESTler to perform stateful REST API fuzzing by automatically generating and executing test sequences that exercise API endpoints, discover producer-consumer dependencies between requests, and find security and reliability bugs. The tester compiles an OpenAPI specification into a RESTler fuzzing…

xalgorix/xalgorix · 123 tokens