Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
9.9

CVE-2026-63469: fastapi-code-generator may execute code on import

CVE-2026-63469 · published 1 day ago
Summary

The fastapi-code-generator tool builds FastAPI apps from OpenAPI files. Versions before 0.8.1 insert a response status‑code value without proper escaping, allowing an attacker to craft input that runs arbitrary code when the generated module is imported. Update the tool to version 0.8.1 or later to stop this behavior.

What to do

The CVE record does not list a fixed version. Check the vendor's site or the advisory links below - a fix may already be released.

Affected software
VendorProductAffected versions
koxudaxi fastapi-code-generator < 0.8.1
Original advisory text
fastapi-code-generator: Import-time RCE via response status-code key -> unescaped @app.get(..., responses={...}) dict
fastapi-code-generator creates FastAPI applications from OpenAPI files. Prior to 0.8.1, the generator inserts an additional response status-code key into the generated responses={...} route-decorator dictionary as a single-quoted Python string without escaping embedded quotes. A multi-response OpenAPI operation with an attacker-controlled or attacker-influenced second non-primary response key can close the dictionary-key literal and inject a valid Python expression. Syntax-breaking input only causes generation to fail, but syntactically valid generated code executes with the application's or CI process's privileges when the generated module is imported and its decorator arguments are evaluated. This additional-response-key sink is distinct from the project's separate route-path and operation-summary sinks. This issue is fixed in version 0.8.1.
Severity
9.9 Critical
Exploitation
<1% chance of attack within 30 days
Type
CWE-94Code Injection
CWE-116Improper Encoding or Escaping of Output
Timeline
Published3 Nov 2026
Updated4 Nov 2026
First seen3 Nov 2026
Sources
CVE-2026-63469 · MITRE
Track software like this
Free during beta