fastapi-code-generator: Import-time RCE via route path -> unescaped @app.get('...') decorator
Affects fastapi-code-generator versions before 0.8.1 when the generated module is imported, as an ASGI server does at startup. Fixed in 0.8.1.
Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.
- Exploited
- No known exploitation
- Fix
- Fixed in 0.8.1
- Who is exposed
- Not reported
Do first: Upgrade to a fixed version: 0.8.1.
- Exploitation?/40Exploitation: unknown (data gap). No CISA SSVC exploitation rating yet
- Exposure17/25No login or user action needed, reachable over the network without a login · Data gap: Advisories don't say whether default setups are affected
- Reach?/20Reach: unknown (data gap). No tracked technology or package matched
- Severity9.3/10CVSS 9.3
- No patch0/5No signal
What would change the score
- Would score about 71 if added to CISA KEV
- Would score about 66 if CISA's SSVC rates exploitation active
- Would score about 31 if advisories confirm default setups are exposed
CVE-2026-63471 is not in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code is tracked. It is rated CVSS 9.3 (critical) and affects fastapi-code-generator; fixed in 0.8.1.
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- Published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- A 0-100 score for how much a CVE matters across the industry: exploitation, exposure, how widely the software is used, severity and whether a fix exists.What do these mean? →
- 26/100 · provisional
- How many real-world setups can hit the bug, from the vendor's advisory and CISA data. It does not know your setup.What do these mean? →
- Unclear
- Fix
- Fixed in 0.8.1
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
fastapi-code-generator, a tool that builds FastAPI applications from OpenAPI files, is affected before version 0.8.1. A malicious or tampered OpenAPI route path can inject Python code into the generated application, which then runs with the privileges of the application or the CI process when the module is imported.
Read the original description
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.
What to do
Upgrade to a fixed version: 0.8.1.
Timeline
- CVE published
- First seen by cve.now
- Posted on X by cve.now
Affected versions
- koxudaxi fastapi-code-generator
fixed in 0.8.1
Evidence 4
- Advisory
- Repository
- Repository
- Repository
Corrections
None so far.
Something wrong on this page? Report an error. Every fix is listed here.
Questions about CVE-2026-63471
Is CVE-2026-63471 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data
What does this mean?
The generator writes route paths into @app.get('...') decorators without escaping them. Because the decorator is evaluated when the generated module is imported, the bug allows remote code execution at import time.Source: github.com
Which versions are affected by CVE-2026-63471?
fastapi-code-generator: before 0.8.1.Source: cve.now feed data
Am I affected, and how do I check?
Versions before 0.8.1 of fastapi-code-generator are affected. The problem needs the generated module to be imported, which an ASGI server does at startup. To check a installed copy, run pip show fastapi-code-generator and compare the Version line with 0.8.1.Source: github.com
How do I fix CVE-2026-63471?
Upgrade fastapi-code-generator to 0.8.1 or later, which is the patched version named in the advisory.Source: github.com