Patchfirst
CVE-2026-63470 Critical · 9.3 EPSS 0.5%

fastapi-code-generator: Call-time RCE via operation summary -> unescaped route-handler docstring

Fix:upgrade fastapi-code-generator to 0.8.1 or later also fixes CVE-2026-63469, CVE-2026-63471 Details ↓

koxudaxi · fastapi-code-generator

Summary

fastapi-code-generator, a tool that creates FastAPI applications from OpenAPI files, fails to escape triple double quotes in an operation summary when it inserts that summary into a generated route-handler docstring. An attacker who controls or influences the operation summary can break out of the docstring and inject a Python expression that runs with the server process's privileges when the affected route handler is called, with no authentication or user interaction required in the attack vector given.

Official description · NVD

fastapi-code-generator creates FastAPI applications from OpenAPI files. Prior to 0.8.1, the generator inserts Operation.summary into a generated route-handler docstring as a triple-double-quoted string without escaping embedded triple quotes. An attacker-controlled or attacker-influenced operation summary can close the docstring and inject a valid Python expression statement into the handler body. Syntax-breaking input only causes generation to fail, but syntactically valid generated code executes with the server process's privileges when the affected route handler is called. This call-time route-handler docstring sink is distinct from the project's separate import-time route-path and additional-response-key sinks. This issue is fixed in version 0.8.1.

Breakdown
16.9 / 100
Exploited
Not confirmed
Reports
0
Tactics
0/15

Disclosed on 3 Nov 2026. No public exploit code or confirmed exploitation is recorded.

Affected versions and fixes

as published in the CVE record

koxudaxi fastapi-code-generator

Affected: < 0.8.1

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: fastapi-code-generator.

PyPIfastapi-code-generatorGHSA-h667-4jj2-cgv4

Upgrade to 0.8.1 or later

Fixes this CVE and 2 other known vulnerabilities in this package (CVE-2026-63469, CVE-2026-63471).

pippip install "fastapi-code-generator>=0.8.1"

The first fix for CVE-2026-63470.

Affected versions

If you runUpgrade to
All versions before 0.8.10.8.1

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 8 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

4 links, grouped by NVD tag (1 duplicate merged)
↑ ↓ chooseEnter openEsc close