CVE-2026-63471: fastapi-code-generator code injection via unescaped OpenAPI path

CVE-2026-63471 · Severity: critical · CVSS 4 · Published 2026-11-03

fastapi-code-generator is a tool that automatically creates FastAPI web applications from OpenAPI specification files. When processing OpenAPI path definitions, versions prior to 0.8.1 fail to escape single quotes in paths, allowing an attacker to inject arbitrary Python code that executes when the generated application module is imported—potentially with CI/build system privileges.

Technologies: Koxudaxi Fastapi-Code-Generator, fastapi-code-generator (PyPI). Vendors: Koxudaxi, PyPI.

Quick answers

Is CVE-2026-63471 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-63471 being exploited in the wild.
How severe is CVE-2026-63471?
Critical severity, with a CVSS score of 4, published 3 November 2026.
Which products and versions are affected?
Koxudaxi Fastapi-Code-Generator before 0.8.1; fastapi-code-generator (PyPI) < 0.8.1, ECOSYSTEM:introduced=0,fixed=0.8.1.
Is there a fix for CVE-2026-63471?
Yes. fastapi-code-generator (PyPI): upgrade to 0.8.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-63471 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-63471?
Check whether you run Koxudaxi Fastapi-Code-Generator or fastapi-code-generator (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • fastapi-code-generator (PyPI): upgrade to 0.8.1 or later
    pip install "fastapi-code-generator>=0.8.1"

Technical details

The vulnerability is a code injection flaw in the code generation phase: the tool inserts OpenAPI paths directly into Python @app.get(...) decorator strings without escaping embedded quotes. An attacker-controlled OpenAPI path can close the string literal and inject valid Python expressions into the decorator argument. When the generated module is imported, the decorator is evaluated and the injected code executes. The attack requires control over the OpenAPI specification input, and syntactically valid payloads achieve code execution.

Affected products

  • koxudaxi fastapi-code-generator before 0.8.1

Identifiers

  • CVE-2026-63471
  • GHSA-p2mm-64f6-gmpp

Timeline

  • 2026-07-01: patched: Fix merged to main branch
  • 2026-11-03: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.