Packages
FastAPI 0.165.0: Quadratic DoS Fix, Form Limits, and Python 3.11+ Migration Guide
Technical breakdown of FastAPI 0.162 through 0.165.0 (MIT, Python 3.11-3.15): patches AIKIDO-2026-463717 quadratic parameter-scanning DoS (0.163.2+), adds request body and form parsing limits (HTTP 413/400), Depends(max_concurrency=...), and drops Python 3.10.
8 min read
FastAPI 0.165.0: Quadratic DoS Fix, Form Limits, and Python 3.11+ Migration Guide
Executive Summary
FastAPI (fastapi on PyPI, MIT license), Python's flagship type-hinted ASGI web and AI API framework built on Starlette and Pydantic, shipped a rapid series of architectural and security releases culminating in 0.165.0 on November 18, 2026 (verified as of December 3, 2026). Across 0.162.0 through 0.165.0, the framework moved to Python 3.11–3.15 (dropping Python 3.10), added Depends(max_concurrency=...) for dependency-level concurrency throttling, introduced request body size limits (0.164.0) and configurable form parsing limits (0.165.0), and patched a High-severity quadratic CPU DoS vulnerability (AIKIDO-2026-463717, affecting 0.115.0–0.163.1, fixed in 0.163.2).
Because FastAPI serves as the API layer for high-throughput AI inference services, RAG backends, and microservice gateways—such as multi-GPU retrieval pipelines handling ~19 queries/sec at 64–128 concurrent requests (arXiv:2611.21003)—upgrading to 0.165.0 closes an event-loop starvation vector while giving teams native HTTP 413 and HTTP 400 payload guardrails.
Confidence Assessment: High for GitHub release tags (0.162.0–0.165.0), Arch Linux package metadata (0.165.0-1, 325.7 KB / 2.5 MB installed), Aikido advisory AIKIDO-2026-463717, and skakarh.com's November 2026 release breakdown. Medium for exact trailing 30-day PyPI download totals for fastapi, as PyPI's public snippet omits the raw monthly counter.
Adoption Telemetry & Version Changelog
PyPI, Distro & Dependency Telemetry (Verified December 3, 2026)
| Metric | Verified Value | Source & Verification Date |
|---|---|---|
| Package & Ecosystem | fastapi (PyPI, conda-forge, Arch Linux, Debian Sid, MIT) |
PyPI / Arch Linux (Dec 3, 2026) |
| Latest Release | 0.165.0 (Signed GPG release 05e6df7, Nov 18, 2026) |
GitHub Releases |
| Python Compatibility | Python 3.11 – 3.15 (3.10 dropped in 0.162.6 on Nov 13, 2026) |
skakarh.com |
| Package Footprint | 325.7 KB compressed · 2.5 MB installed (python-fastapi 0.165.0-1) |
Arch Linux |
| Core & Runtime Deps | starlette, pydantic (2.14+), anyio >= 4.1.0, opentelemetry-api, fastar (0.12.0), httpx2 / httpx |
conda-forge / FastAPI Release Notes |
Recent Release Timeline (0.162.0 – 0.165.0)
According to GitHub Releases and FastAPI 2026 Release Notes:
0.162.0 – 0.162.7(Oct 23 – Nov 13, 2026): Restored standard Pydantic default handling for omittedbool/bool | Noneform fields (0.162.0), added Python 3.15 support and locked Pydantic2.14(0.162.3), requiredAnyIO >= 4.1.0(0.162.4), and dropped Python 3.10 (0.162.6). Also bumpedfastarto0.12.0and madeopentelemetry-apia runtime dependency (OpenEmbedded patch).0.163.0 – 0.163.2(Nov 14 – Nov 17, 2026): AddedDepends(max_concurrency=...)(0.163.0), fixed OpenAPI schema generation for response models with nested computed fields (0.163.1), and shipped the quadratic parameter-scanning DoS fix (0.163.2).0.164.0&0.165.0(Nov 18, 2026): Shipped request body size limits (HTTP 413on0.164.0) followed immediately by configurable form parsing limits (PR #16784,HTTP 400on0.165.0) plus an official coding-agent skill installable viauvx library-skills.
Security Patches, Breaking Changes & Internals
AIKIDO-2026-463717: Quadratic Parameter-Scanning DoS (Fixed in 0.163.2)
On November 24, 2026, Aikido Intel published advisory AIKIDO-2026-463717 (Aikido Score 75, High Denial of Service) affecting fastapi 0.115.0 through 0.163.1:
- Root Cause: FastAPI repeatedly scanned incoming request parameters while extracting unused query, header, and form fields. Requests packed with many parameters triggered quadratic $O(n^2)$ CPU work directly on the ASGI worker's event loop, stalling unrelated concurrent API requests.
- Who Is Exposed: Any service on
0.115.0–0.163.1exposing endpoints that extractQueryorHeaderparameters (including Pydantic query/header parameter models) or acceptForm()/File()payloads. - The Fix (
0.163.2+): FastAPI refactored parameter extraction to group parameter values in a single linear traversal, eliminating quadratic rescanning even when a small request body stays well under reverse-proxy byte caps.
Breaking Changes: Python 3.10 Drop, Boolean Forms & HTTP 413/400 Limits
Teams upgrading from earlier 2026 releases (0.141.x–0.161.x) should audit four behavioral changes before deploying 0.165.0:
- Python
>= 3.11Required (0.162.6+): Python3.10is no longer supported. Container base images must runPython 3.11through3.15alongsideanyio >= 4.1.0. - Omitted Boolean Form Fields (
0.162.0+): FastAPI no longer infersFalsewhen aboolorbool | Noneform field is omitted; it now applies the field's declared default or returns a missing-field validation error, matching standard Pydantic behavior. - Configurable Body & Form Limits (
0.164.0–0.165.0): Oversized request bodies now triggerHTTP 413, while exceeding configured form field or file limits returnsHTTP 400. Limits can be scoped at theFastAPIapp,APIRouter,include_router(), or individual path-operation level. Depends(max_concurrency=...)(0.163.0+): Lets you cap concurrent holders of an expensive dependency (such as a database session or local GPU inference lock) so excess callers wait asynchronously without blocking worker threads.
Parameter Model Changes (0.156.0 – 0.161.1) & Header Hardening
Teams jumping straight from 0.141.x or 0.151.x to 0.165.0 also inherit several parameter-handling shifts documented across skakarh.com and FastAPI's official release notes:
Field()Metadata Preserved (0.156.0): PydanticField()attributes and metadata are now retained on request parameter models rather than dropped during OpenAPI generation.- Combined Parameter Models (
0.157.0) &extraConfig (0.160.0): Routes can combine query, header, and cookie parameter models cleanly, and since0.160.0, each parameter model'sextraconfiguration (forbid,ignore,allow) applies to its sibling fields. - Underscore Header Rejection (
0.136.3+): Whenconvert_underscores=True(the default), FastAPI rejects raw underscore headers to prevent header-smuggling ambiguity across reverse proxies.
Scoped Form Limits & Official uvx library-skills Support
In 0.165.0, form parsing limits are not limited to a single global setting: you can configure them at the FastAPI app, APIRouter, include_router(), or individual path-operation level—letting public upload routes enforce tight field caps while internal admin routes allow larger multipart forms. Notably, FastAPI 0.164.0 and 0.165.0 also bundle an official coding-agent skill (uvx library-skills) so AI assistants like Claude Code and Cursor generate 0.165-accurate Depends(max_concurrency=...) and limit configurations instead of deprecated 0.11x idioms.
Updated Usage Example (0.165.0 Concurrency & Form Guardrails)
from typing import Annotated
from fastapi import Depends, FastAPI, Form
app = FastAPI()
async def get_inference_slot():
# Release slot when request finishes
yield "slot_acquired"
@app.post("/v1/analyze")
async def analyze_payload(
prompt: Annotated[str, Form()],
_slot: Annotated[str, Depends(get_inference_slot, max_concurrency=5)],
):
return {"status": "queued", "prompt_len": len(prompt)}
For TestClient suites, note that FastAPI now supports httpx2 (or httpx) as an optional test dependency (PR #16512 moved httpx2 to optional dependencies while resolving deprecation warnings).
Ecosystem Comparison & Upgrade Checklist
Python API & Async Framework Comparison (Verified December 2026)
| Framework | Latest Verified Version | Python Floor & License | Key Security & Concurrency Highlights |
|---|---|---|---|
fastapi |
0.165.0 (Nov 18, 2026) |
Python 3.11–3.15 · MIT |
Patches AIKIDO-2026-463717 (0.163.2+), Depends(max_concurrency=...), HTTP 413/400 limits |
aiohttp |
3.14.5 (Oct 10, 2026) |
Python 3.10–3.15t · Apache-2.0 |
Patches CVE-2026-128126 (3.14.4+), full client+server stack, cp315t free-threading wheels |
litestar / flask |
Varies by branch | Python 3.9+ / 3.10+ |
Litestar offers built-in DI/DTOs; Flask requires sync WSGI or ASGI wrappers and manual schema validation |
Production Context & fastapi[standard] Runtime Stack
On PyPI, FastAPI highlights production deployments across Microsoft (ML services), Uber (Ludwig prediction REST server), Netflix (Dispatch crisis orchestration), and Cisco (Virtual TAC Engineer). Installing fastapi[standard] pulls in uvicorn[standard] (with uvloop), python-multipart (required for request.form() and Form()/File() endpoints), jinja2, and fastapi-cli, while Typer serves as FastAPI's companion CLI framework.
Distro & Embedded Packaging (Arch, Debian, OpenEmbedded)
Downstream OS and embedded distributions are actively tracking the 0.162–0.165 jump:
- Rolling & Unstable Distros: Arch Linux shipped
python-fastapi 0.165.0-1(325.7 KBpackage,2.5 MBinstalled) on November 21, 2026, while Debian Sid and NetBSD pkgsrc carry0.162.4alongsidepy-httpx2. - Embedded Linux (
OpenEmbedded): An October 31, 2026 Yocto/OpenEmbedded patch upgradingpython3-fastapifrom0.141.1to0.162.0notes thatopentelemetry-apiis now a runtime dependency andopentelemetry-sdkis required forptestsuites (withlogfire-dependent telemetry tests skipped).
Safe Upgrade & Pinning Checklist
- Check Python Runtime Before Bumping: Ensure all Dockerfiles and CI runners use Python 3.11 or newer (
3.11–3.15), asfastapi >= 0.162.6drops Python3.10. - Pin Exact
0.165.0inpyproject.toml: Because FastAPI ships breaking parsing and limit changes in0.xminor releases, pin an exact version in CI:uv add "fastapi[standard]==0.165.0" "anyio>=4.1.0" - Add Negative QA Tests for
HTTP 413&400: As recommended in skakarh.com's tester guide, add automated tests posting one form field or file over your configured limit to verifyHTTP 400and oversized bodies to verifyHTTP 413. - Audit
boolForm Endpoints, Observability & Agent Skills: Test any legacy HTML/form endpoints expecting omitted checkboxes to coerce toFalse, verifyopentelemetry-apicompatibility in minimal container builds, and runuvx library-skillsif your team uses AI coding assistants on the repo.
Frequently Asked Questions
1. Which FastAPI versions are affected by AIKIDO-2026-463717?
Versions 0.115.0 through 0.163.1 are affected by the quadratic parameter-scanning CPU DoS flaw, impacting routes that extract Query or Header parameters (including Pydantic models) or accept Form()/File() data. Upgrading to 0.163.2 or 0.165.0 resolves it by grouping parameter values in a single traversal.
2. Does FastAPI 0.165.0 still support Python 3.10?
No. FastAPI dropped Python 3.10 support in 0.162.6 (November 13, 2026). Current releases require Python 3.11 through 3.15.
3. How does Depends(max_concurrency=...) work in FastAPI 0.163+?
Added in 0.163.0, Depends(dep, max_concurrency=5) caps how many concurrent requests can hold that dependency (such as a database session) at once; additional requests wait asynchronously without blocking a worker thread.
4. What HTTP status codes do the new FastAPI 0.164/0.165 limits return?
Oversized request bodies introduced in 0.164.0 return HTTP 413, while exceeding configurable form field or file limits introduced in 0.165.0 returns HTTP 400, configurable per app, APIRouter, include_router(), or individual route.
5. Why did opentelemetry-api appear in recent FastAPI dependency lists?
Recent 0.162.x builds added opentelemetry-api as a runtime dependency alongside anyio >= 4.1.0, starlette / fastar, and pydantic (2.14+), while httpx2 moved to optional dependencies (PR #16512).
Sources
- GitHub (
fastapi/fastapi) — Releases:0.162.3through0.165.0(https://github.com/fastapi/fastapi/releases) — Released Nov 18, 2026 (05e6df7). - Aikido Intel —
AIKIDO-2026-463717: FastAPI0.115.0–0.163.1High DoS Vulnerability (https://intel.aikido.dev/cve/AIKIDO-2026-463717) — Published Nov 24, 2026. - skakarh.com — FastAPI Release Notes 2026: Every Version Explained (
0.137–0.165) (https://www.skakarh.com/blog/fastapi-release-notes) — Published Nov 23, 2026 (updated Nov 27, 2026). - Arch Linux Packages —
python-fastapi 0.165.0-1Package Metadata (https://archlinux.org/packages/extra/any/python-fastapi/) — Updated Nov 21, 2026. - PyPI (
fastapi) & FastAPI Official Release Notes — FastAPI Documentation & Release Notes (https://pypi.org/project/fastapi/andhttps://fastapi.tiangolo.com/release-notes/) — Updated Nov 18, 2026. - prefix.dev / conda-forge —
fastapi v0.162.4Dependency Graph (https://prefix.dev/channels/conda-forge/packages/fastapi) — Synced Nov 12, 2026. - OpenEmbedded / Yocto Patchwork —
python3-fastapi: Upgrade 0.141.1 -> 0.162.0(https://patchwork.yoctoproject.org/project/oe/patch/20261031035748.2130261-6-khem.raj@oss.qualcomm.com/) — Posted Oct 31, 2026. - arXiv (
2611.21003v1) — K2-Horizon FastAPI 8-GPU Retrieval Benchmark (https://arxiv.org/html/2611.21003v1) — Published Nov 16, 2026.