Read the docs
TI-2026-84481 Aliases CVE-2026-63471

Code injection in fastapi-code-generator via OpenAPI route paths

Priority HIGH 81CWE-116Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Attack requirements
None
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-94.

Summary

fastapi-code-generator versions before 0.8.1 create FastAPI applications from OpenAPI files. The generator inserts an OpenAPI path into a generated route decorator inside a single-quoted string without escaping embedded quotes (CWE-116, CWE-94). An attacker who controls or influences the OpenAPI path can close the string and inject a Python expression that runs with the application's or CI process's privileges when the generated module is imported.

Written with Claude Haiku 5.5 from the sources below · 2026-11-07

Description from the CNA

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00312 24th percentileScored 2026-11-07
Fix Fixed fastapi-code-generator (koxudaxi): 0.8.1

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
koxudaxifastapi-code-generatorbefore 0.8.10.8.1Patch availableCNA
  • fastapi-code-generator Vendorkoxudaxi Affected before 0.8.1 Fixed in 0.8.1 Patch available CNA

Remediation

Upgrade fastapi-code-generator to version 0.8.1, which fixes this issue.

Written with Claude Haiku 5.5 from the sources below · 2026-11-07

  • Fix · CNA fastapi-code-generator (koxudaxi) Fixed in 0.8.1

Timeline

  1. 2026-11-03 Threatist record created from CVE-2026-63471
  2. 2026-11-07 CISA SSVC decision points changed
  3. 2026-11-07 Priority changed: MEDIUM → HIGH

References

  • TI-2026-84480 Code injection in fastapi-code-generator route docstrings CVSS 4.0CRITICAL 9.3
  • TI-2026-39961 Arbitrary local file read via XSD `schemaLocation` (`xs:include`/`xs:import`) path traversal, with no remote-ref gate CVSS 3.1HIGH 7.5
  • TI-2026-39960 Information disclosure in koxudaxi datamodel-code-generator CVSS 3.1HIGH 7.5
  • TI-2026-39512 datamodel-code-generator vulnerable to SSRF via --url: no host/IP validation, follows redirects CVSS 3.1HIGH 8.2
  • TI-2026-39511 datamodel-code-generator vulnerable to SSRF via JSON-Schema `$ref` to HTTP URL (silent by default) CVSS 3.1HIGH 8.2
  • TI-2026-39483 Code injection in koxudaxi datamodel-code-generator CVSS 3.1HIGH 7.8
See all 15 →

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences