{"id":"CVE-2026-63470","kind":"vulnerability","aliases":["CVE-2026-63470"],"related":[],"title":"fastapi-code-generator: OpenAPI summaries inject Python code into generated handlers","description":"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.","summary":"fastapi-code-generator turns OpenAPI files into FastAPI applications and, before 0.8.1, pasted each operation's summary into a handler docstring without escaping embedded triple quotes. An attacker who controls or influences a summary can break out of the docstring and get injected Python that runs with the server's privileges when the route is called.","severity":"critical","cvss":9.3,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["code-generation","fastapi","openapi","package","python"],"not_affected_if":["no-generator-use","trusted-openapi-only","version-0.8.1-or-later"],"how_to_check":"- Check the installed version of fastapi-code-generator with `pip show fastapi-code-generator` or `pip freeze | grep fastapi-code-generator`.\n- Find the generated FastAPI route handlers and review whether any were generated from OpenAPI files with summaries you do not control.","fix":"- fastapi-code-generator: move to `0.8.1` or later.","status":"open","published_at":"2026-11-03T20:18:15+00:00","first_seen_at":"2026-11-03T20:49:22+00:00","triaged_at":"2026-11-03T20:49:44+00:00","updated_at":"2026-11-03T20:49:44+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-11-03T20:49:44Z","model":"claude-haiku-5-5","output":{"fix":"- fastapi-code-generator: move to `0.8.1` or later.","reach":"unknown","title":"fastapi-code-generator: OpenAPI summaries inject Python code into generated handlers","impact":"high","summary":"fastapi-code-generator turns OpenAPI files into FastAPI applications and, before 0.8.1, pasted each operation's summary into a handler docstring without escaping embedded triple quotes. An attacker who controls or influences a summary can break out of the docstring and get injected Python that runs with the server's privileges when the route is called.","audience":"developers","category":"package","nicknames":[],"who_cares":["python","fastapi","openapi","code-generation"],"confidence":0.7,"fix_status":"available","needs_auth":"unknown","worst_case":"Injected code runs on the server with the process's privileges when the route is called.","analyst_note":"Confirm how an attacker would influence the OpenAPI summary in typical pipelines and whether the NVD entry or linked vendor advisory describes a reachable input path.","how_to_check":"- Check the installed version of fastapi-code-generator with `pip show fastapi-code-generator` or `pip freeze | grep fastapi-code-generator`.\n- Find the generated FastAPI route handlers and review whether any were generated from OpenAPI files with summaries you do not control.","plain_action":"","needs_analyst":true,"not_affected_if":["version-0.8.1-or-later","no-generator-use","trusted-openapi-only"],"who_is_affected":"Teams that run fastapi-code-generator to produce FastAPI server code from OpenAPI files, especially where the OpenAPI document comes from outside the team or is edited by others. Generated code that is written once and reviewed by hand is less exposed than an automated pipeline that regenerates code from external specs. Teams that do not use the generator, or that only generate from specs they fully author, are less exposed.","user_interaction":"no","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000773,"input_tokens":4302,"output_tokens":686,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2026':14A,17A '-63470':15A,18A '0.8.1':38B,95C,206C 'addit':196C 'additional-response-key':195C 'affect':167C 'applic':35B,89C 'attack':54B,121C,125C 'attacker-control':120C 'attacker-influenc':124C 'bodi':143C 'break':62B,146C 'call':82B,171C,174C 'call-tim':173C 'caus':149C 'close':130C 'code':3A,9A,20B,28B,85C,157C 'code-gener':19B 'control':56B,122C 'creat':87C 'cve':13A,16A 'distinct':182C 'docstr':47B,66B,106C,132C,179C 'doubl':111C 'embed':50B,116C 'escap':49B,115C 'execut':158C 'express':138C 'fail':152C 'fastapi':2A,22B,27B,34B,84C,88C 'fastapi-code-gener':1A,26B,83C 'file':32B,92C 'fix':203C 'generat':4A,11A,21B,29B,86C,97C,102C,150C,156C 'get':68B 'handler':12A,46B,105C,142C,169C,178C 'import':189C 'import-tim':188C 'influenc':58B,126C 'inject':7A,69B,134C 'input':147C 'insert':98C 'issu':201C 'key':198C 'openapi':5A,23B,31B,91C 'oper':41B,127C 'operation.summary':99C 'packag':24B 'past':39B 'path':193C 'prior':93C 'privileg':77B,164C 'process':162C 'project':185C 'python':8A,25B,70B,137C 'quot':52B,112C,118C 'respons':197C 'rout':80B,104C,168C,177C,192C 'route-handl':103C,176C 'route-path':191C 'run':72B 'separ':187C 'server':75B,161C 'sink':180C,199C 'statement':139C 'string':113C 'summari':6A,43B,60B,128C 'syntact':154C 'syntax':145C 'syntax-break':144C 'time':175C,190C 'tripl':51B,110C,117C 'triple-double-quot':109C 'turn':30B 'valid':136C,155C 'version':205C 'without':48B,114C","nicknames":[],"mitigations":[],"who_affected":"Teams that run fastapi-code-generator to produce FastAPI server code from OpenAPI files, especially where the OpenAPI document comes from outside the team or is edited by others. Generated code that is written once and reviewed by hand is less exposed than an automated pipeline that regenerates code from external specs. Teams that do not use the generator, or that only generate from specs they fully author, are less exposed.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["codegeneration","critical","fastapi","openapi","package","python"],"campaign_type":null,"first_public_at":"2026-07-01T09:45:59+00:00","kev":null,"cvss_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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"security-advisories@github.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-63470","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63470","severity":null,"published_at":"2026-11-03T20:18:15+00:00","modified_at":"2026-11-03T20:31:38+00:00","first_seen_at":"2026-11-03T20:49:22+00:00","fetched_at":"2026-11-03T20:49:22+00:00","note":null}],"documents":[{"id":60586,"url":"https://github.com/koxudaxi/fastapi-code-generator/commit/49301dbdb82170d7f50877419d994b05cb1fa2bc","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":60587,"url":"https://github.com/koxudaxi/fastapi-code-generator/commit/b3b9bd66e0b0c4d8c686fda700258104615a1332","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":60588,"url":"https://github.com/koxudaxi/fastapi-code-generator/releases/tag/0.8.1","title":"Release notes: github.com","kind":"release","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release notes: github.com"},{"id":60593,"url":"https://github.com/koxudaxi/fastapi-code-generator/security/advisories/GHSA-h667-4jj2-cgv4","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-07-01T09:45:59+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}