CVE-2026-63471
Deferred Deferred - Pending Action

Code Injection in FastAPI Code Generator

Vulnerability report for CVE-2026-63471, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-11-03

Last updated on: 2026-11-03

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-11-03
Last Modified
2026-11-03
Generated
2026-11-03
AI Q&A
2026-11-03
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
koxudaxi fastapi-code-generator < 0.8.1

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
CWE-116 The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

The vulnerability in fastapi-code-generator (before version 0.8.1) involves improper handling of OpenAPI paths. When generating FastAPI routes, the tool inserts user-controlled paths into Python string decorators without escaping quotes. This allows attackers to inject malicious Python code into the decorator, which executes when the generated module is imported.

Detection Guidance

This vulnerability requires checking for vulnerable versions of fastapi-code-generator. Run pip show fastapi-code-generator to check the installed version. If it is below 0.8.1, the system is vulnerable.

Impact Analysis

If you use a vulnerable version of fastapi-code-generator, an attacker could craft an OpenAPI file with a malicious path that executes arbitrary code with the privileges of the application or CI process when the generated code is imported. This could lead to data breaches, system compromise, or unauthorized actions.

Mitigation Strategies

Upgrade fastapi-code-generator to version 0.8.1 or later using pip install --upgrade fastapi-code-generator. Review any generated FastAPI code for suspicious route decorators that may contain injected code.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-63471. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...