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

fastapi-code-generator: Import-time RCE via route path -> unescaped @app.get('...') decorator

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

koxudaxi · fastapi-code-generator

Summary

fastapi-code-generator, prior to version 0.8.1, fails to escape quotes in OpenAPI path values when it writes them into generated @app.get(...) route decorators, so an attacker-influenced path can inject a Python expression into the decorator argument. An attacker who can supply or influence the OpenAPI file can have injected code run with the privileges of the application or CI process once the generated module is imported and the decorator is evaluated, with no authentication, network access, or user interaction required.

Official description · NVD

fastapi-code-generator creates FastAPI applications from OpenAPI files. Prior to 0.8.1, the generator inserts an OpenAPI path into a generated @app.get(...) route decorator as a single-quoted generated route string without escaping embedded quotes. An attacker-controlled or attacker-influenced OpenAPI path can close the string and inject a valid Python expression into the decorator argument. 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 the decorator is evaluated. This OpenAPI path sink is distinct from the project's separate operation-summary docstring 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-p2mm-64f6-gmpp

Upgrade to 0.8.1 or later

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

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

The first fix for CVE-2026-63471.

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