hunt-fastapi

Detect FastAPI-specific vulnerabilities including OpenAPI schema exposure and DI authorization gaps.

1.1k|191|Updated Jun 24, 2026
One-click install
npx skills add https://github.com/uphiago/recon-skills --skill hunt-fastapi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hunt-fastapi
Source: https://github.com/uphiago/recon-skills/tree/main/redteam/hunt-fastapi
Command: npx skills add https://github.com/uphiago/recon-skills --skill hunt-fastapi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

FastAPI's unique architecture including dependency injection for authorization, Pydantic for request validation, auto-generated OpenAPI schemas, and ASGI middleware creates specialized attack surfaces that generic web vulnerability scanners often miss, leaving critical application flaws undetected during security assessments.

Core Features & Use Cases

  • OpenAPI Schema Mining: Discover hidden, undocumented endpoints and internal API routes exposed in auto-generated OpenAPI schemas for FastAPI applications.
  • FastAPI-Specific Auth Testing: Identify authorization gaps in dependency injection (Depends) configurations, including endpoints that skip authentication checks entirely or have misconfigured dependency overrides.
  • Pydantic & ASGI Exploitation: Test for type coercion flaws, extra field injection, and proxy header/IP spoofing via misconfigured ASGI middleware and TrustedHost settings.
  • Use Case: When conducting a penetration test of a FastAPI-powered customer portal, use this skill to systematically find hidden admin endpoints in the OpenAPI schema, test for auth bypasses in DI-protected routes, and check for Pydantic coercion flaws that allow attackers to set admin privileges via string inputs.

Quick Start

Use the hunt-fastapi skill to assess the target FastAPI application for dependency injection authorization gaps, hidden OpenAPI endpoints, and Pydantic validation flaws.

Frequently Asked Questions about hunt-fastapi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find hidden endpoints in a FastAPI OpenAPI schema during a pentest?

FastAPI OpenAPI schema mining uncovers hidden, undocumented endpoints and internal API routes exposed in auto-generated schemas. During a pentest, this maps exposed administrative functions and internal API logic that generic web scanners miss.

How does dependency injection create authorization bypass risks in FastAPI?

Dependency injection authorization misconfigurations occur when FastAPI endpoints skip authentication checks or apply misconfigured dependency overrides. Testing Depends configurations identifies routes allowing attackers to entirely bypass authentication mechanisms.

Can I test for Pydantic model coercion and extra field injection flaws?

Pydantic model coercion testing detects type coercion flaws and extra field injection in FastAPI request validation. It exposes validation weaknesses allowing attackers to manipulate inputs, like escalating privileges via string inputs.

Does FastAPI ASGI middleware have common authentication bypass vulnerabilities?

ASGI middleware bypasses occur through proxy header and IP spoofing via misconfigured TrustedHost settings. Testing WebSocket authentication parity and ASGI middleware identifies flaws where attackers spoof headers to bypass security controls.

Why do generic web vulnerability scanners miss FastAPI security flaws?

Generic web vulnerability scanners miss FastAPI security flaws because they do not understand its unique architecture using dependency injection, Pydantic validation, auto-generated OpenAPI schemas, and ASGI middleware, which create specialized attack surfaces.

Can I test WebSocket authentication parity flaws in FastAPI applications?

WebSocket authentication parity testing verifies if WebSocket endpoints enforce the same authorization checks as REST API routes. It identifies authentication gaps in mounted WebSocket integrations and GraphQL endpoints within FastAPI applications.