Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply attacker-influenced OpenAPI spec
-
DeliverySet triple-quote breakout in operation summary
-
ExploitGenerator emits unescaped payload into handler docstring
-
ExecutionOperator deploys generated FastAPI app
-
PersistInvoke affected route endpoint
-
ImpactExecute arbitrary code as server process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that a FastAPI application be generated by fastapi-code-generator (< 0.8.1) from an OpenAPI spec whose Operation.summary field is attacker-controlled or attacker-influenced, and that the generated application then be deployed and the affected route handler actually invoked (the injected expression runs at call time, not at generation time). The payload must be syntactically valid Python that survives the generator's black/isort post-processing - the advisory's technique is '"""+expr+"""' kept valid via '(expr or "")'; a syntax-breaking summary only aborts generation and does not produce a vulnerable artifact. Limiting factors: the attacker needs write influence over the summary data field of the consumed spec, an operator must run the generator and deploy the output, and only the summary-in-handler-docstring path is affected (info.description, tags, parameter defaults are escaped, and models from datamodel-code-generator are repr-escaped). Risk is therefore real only in workflows that generate code from untrusted specs. |
| Impact | The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N, VC:H/VI:H/VA:H) scores this 9.3 Critical and the vuln.today decision label is act_now, signaling it should be remediated immediately. However, the signals must be read against the mechanism: this is a code-generation (build-time) developer tool, and the injected Python only executes at call time inside an application that was GENERATED from an attacker-controlled or attacker-influenced OpenAPI spec and then deployed. The PR:N/UI:N framing implies trivial drive-by remote exploitation, but the real precondition is attacker influence over the operation 'summary' field of the spec consumed by the generator, plus an operator who runs the generator and deploys the resulting handler - so realistic exposure is concentrated in CI/codegen pipelines that build FastAPI apps from untrusted or third-party specs, not in arbitrary internet-facing hosts. No CISA KEV entry is present in the input and no EPSS score was provided, so there is no evidence of active or widespread exploitation; the urgency rests on the act_now label, the Critical rating, and the existence of a reporter PoC rather than on observed in-the-wild activity. Net: a genuine high-impact RCE worth prioritizing wherever specs are untrusted, but materially narrower in real-world reach than the raw 9.3 implies - treat the no-conditions reading of the CVSS as optimistic for the attacker. |
| Exploit ScenarioDerived | An organization auto-generates a FastAPI service from a third-party or user-supplied OpenAPI document; an attacker sets an operation's summary to a triple-quote breakout such as '"""+(__import__("os").system(...) or "")+"""', which fastapi-code-generator writes unescaped into the route handler's docstring as a live expression statement. Once the generated app is deployed, the first request to that endpoint executes the injected code at call time with the server process's privileges. A reporter PoC (reproduce.sh/make_spec.py) demonstrating this was attached to the GHSA advisory and verified on 0.8.0. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 03, 2026
Code generation in fastapi-code-generator before 0.8.1 writes an OpenAPI Operation.summary verbatim into the generated route handler's triple-double-quoted docstring without escaping embedded """, so a crafted summary can close the docstring and inject a Python expression statement into the handler body that executes with the server process's privileges when that endpoint is called. Only code generated from an attacker-controlled or attacker-influenced spec and subsequently deployed is exposed; a syntax-breaking payload merely aborts generation (black/isort post-processing), so the practical payload must be valid Python such as the advisory's '"""+expr+"""' form kept valid with '(expr or "")'. The vendor CVSS 4.0 vector scores 9.3 Critical, our independent assessment is CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (UI:R reflecting that an operator must generate and deploy the code), and the vuln.today decision label is act_now; a public PoC reference exists (reproduce.sh attached to the GitHub advisory, verified against 0.8.0) and no CISA KEV entry applies.
RemediationAI
Upgrade fastapi-code-generator to 0.8.1 or later, which escapes operation summaries for docstring context (vendor-released patch: 0.8.1; corresponding fixes in commits 49301dbdb82170d7f50877419d994b05cb1fa2bc and b3b9bd66e0b0c4d8c686fda700258104615a1332, release notes at https://github.com/koxudaxi/fastapi-code-generator/releases/tag/0.8.1). After upgrading, regenerate and redeploy affected applications, since previously generated source retains the injected or unescaped text. If upgrading must be deferred, generate only from specs you fully trust and treat the summary field of third-party specs as hostile - strip or reject """ and backslash sequences from Operation.summary before running the generator, with the trade-off that legitimate summaries containing quoted text will be altered or dropped; alternatively inspect the generated handler docstrings and bodies before deployment, which is a manual review step that does not scale and does not protect spec pipelines that regenerate automatically. Note that a rejected or malformed summary typically stops generation rather than silently producing safe code, so pipeline failures should be treated as a signal of hostile input.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
fastapi-code-generator is a Python tool that converts OpenAPI documents into FastAPI application source, then formats the result with black and isort. The root cause is CWE-94 (improper control of code generation) compounded by CWE-116 (improper encoding of output): the parser modeled Operation.summary as ordinary text and emitted it into the handler docstring inside a """...""" literal, so a summary containing a triple quote terminates the string and lets the remainder concatenate an arbitrary expression into the function body. Because the injected text lands in an expression statement, it runs at request time when the route handler is invoked, not at import or generation time; this call-time docstring sink is distinct from the project's separate import-time sinks (route path emitted into the @app.get decorator, additional response keys). The upstream fix in 0.8.1 introduces a PythonEscapedString type with single_quoted and triple_double_quoted escaping helpers (backslash doubling plus escaping """) and applies it in model_post_init to summary, path, tags and additional_responses status codes. The advisory notes that info.description, tags and parameter defaults were already escaped and that models produced by datamodel-code-generator are repr-escaped, which bounds the affected field to the operation summary rendered as a handler docstring.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Payload crafting is deterministic (AC:L) and needs no privileges on the target (PR:N), but a developer must generate and deploy code from the attacker-influenced spec, so UI:R; full code execution gives C/I/A:H.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
fastapi-code-generator creates FastAPI applications from OpenAPI files. Prior to 0.8.1, the generator inserts Operation.summary into a generated route-handler docstring as a triple-double-quoted string without escaping embedded triple quotes. An attacker-controlled or attacker-influenced operation summary can close the docstring and inject a valid Python expression statement into the handler body. Syntax-breaking input only causes generation to fail, but syntactically valid generated code executes with the server process's privileges when the affected route handler is called. This call-time route-handler docstring sink is distinct from the project's separate import-time route-path and additional-response-key sinks. This issue is fixed in version 0.8.1.
Articles & Coverage 2
Technical POC Analysis
The bug is CWE-94: the generator constructs Python source code from externally influenced input without neutralizing syntax-significant characters.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
CVE-2026-63470 is a CRITICAL code-injection flaw in fastapi-code-generator that can cause attacker-controlled code to be silently embedded into the route handlers your teams generate and deploy as production services. Because the injection executes with the server process's privileges, a compromised API service can expose data and allow modification or disruption of the affected application. Leadership should care because remediation requires developer workflow changes, not just a server patch, and unpatched versions remain in use until generation pipelines are updated and any previously generated code is reviewed.
No vendor-released patch identified at time of analysis. Interim mitigations: restrict code generation to trusted, internally controlled OpenAPI specifications; scan and review generated docstrings for embedded expression fragments before deployment; run generation in isolated, low-privilege build environments; apply least privilege to server processes that execute generated handlers; monitor deployed services for unexpected outbound activity or process behavior.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-116145
NVD
CVE.org
Vulnrichment
GitHub
Exploit-DB