News · fastapi-code-generator (open source) · 2 min read
Event date: · Published:
Three critical RCE flaws disclosed in fastapi-code-generator, triggerable via AI-generated OpenAPI specs
Researchers disclosed three critical RCE vulnerabilities in fastapi-code-generator that trigger from a malicious OpenAPI spec, two of them at import time with no HTTP request needed. The flaws are fixed in version 0.8.1.
Security researchers disclosed three critical remote-code-execution vulnerabilities in fastapi-code-generator, an open source tool that turns an OpenAPI or JSON-Schema spec directly into a runnable FastAPI application, on November 9, 2026. The flaws stem from unescaped string injection in the Python code the tool generates and can be triggered simply by feeding it a malicious spec, a realistic path when specs are produced or relayed by an AI coding agent, according to the GitHub Security Advisory covering CVE-2026-63471.
What changed
- CVE-2026-63471 ("import-time RCE via route path") is rated CVSS v4.0 9.3, Critical
- CVE-2026-63469 ("import-time RCE via response status-code key") shares the same unescaped single-quote injection root cause
- CVE-2026-63470 ("call-time RCE via operation summary") injects an unescaped summary field into generated route-handler docstrings, executing at call time
- CVE-2026-63471 and CVE-2026-63469 execute at import time, so the ASGI server only needs to start up, no HTTP request is required
- All three affect fastapi-code-generator versions 0.0.1 through 0.8.0 and are fixed in version 0.8.1
What it means for builders
fastapi-code-generator is common scaffolding in AI-assisted backend and codegen workflows. Exploitation requires only the ability to influence the input OpenAPI spec, not direct access to the running service, so an attacker-controlled or agent-produced spec can achieve remote code execution purely by triggering code generation or import, with no further request needed. Teams running agentic codegen pipelines with this library should treat the upgrade as urgent.
Availability and next steps
The fix ships in fastapi-code-generator 0.8.1. Projects on versions 0.0.1 through 0.8.0 are affected and should upgrade immediately, particularly where OpenAPI specs can originate from or pass through an AI agent before code generation.
Sources
- fastapi-code-generator: Import-time RCE via route path (CVE-2026-63471) (GitHub Security Advisories, November 9, 2026, official)
Written with AI assistance, strictly from the sources listed above. Before it went live, automated checks verified its dates, sources and every language edition.