fastapi-code-generator: Import-time RCE via response status-code key -> unescaped @app.get(..., responses={...}) dict
Affected
| Package | Affected versions | Fixed in |
|---|---|---|
| pip:fastapi-code-generator | < 0.8.1 | 0.8.1 |
fastapi-code-generator (koxudaxi) emits an operation's extra responses into the route decorator's responses={...} dict, using each response's status-code key as a single-quoted string literal without escaping the '. A ' in a status-code key closes the dict-key string and, via concatenation, injects a live expression that the decorator argument evaluates when main.py is imported (the ASGI server imports it at startup) -- code execution, no request. The status-code key is a pure data field. Verif…
Read on GitHub Advisory Database
On 11/10/2026, 04:46 AM, GitHub Advisory Database published "fastapi-code-generator: Import-time RCE via response status-code key -> unescaped @app.get(..., responses={...}) dict" (type: Advisory). Severity is "Critical" (critical). Related technologies: Python, FastAPI. CVE: CVE-2026-63469.