{"id":"CVE-2026-63469","kind":"vulnerability","aliases":["CVE-2026-63469"],"related":[],"title":"fastapi-code-generator: crafted OpenAPI response key injects Python code","description":"fastapi-code-generator creates FastAPI applications from OpenAPI files. Prior to 0.8.1, the generator inserts an additional response status-code key into the generated responses={...} route-decorator dictionary as a single-quoted Python string without escaping embedded quotes. A multi-response OpenAPI operation with an attacker-controlled or attacker-influenced second non-primary response key can close the dictionary-key literal and inject a valid Python expression. 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 its decorator arguments are evaluated. This additional-response-key sink is distinct from the project's separate route-path and operation-summary 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, wrote a non-primary response status-code key into generated Python without escaping quotes. An attacker who controls that OpenAPI input can make the generated code run arbitrary Python with the privileges of the app or CI process that imports it.","severity":"critical","cvss":9.3,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["ci","fastapi","openapi","package","python"],"not_affected_if":["trusted-openapi-only","version-0.8.1-or-later"],"how_to_check":"- Check the installed version of fastapi-code-generator, for example with `pip show fastapi-code-generator`, and see whether it is below `0.8.1`.\n- Look for CI jobs or pipelines that run fastapi-code-generator on OpenAPI files from outside the team.\n- Review generated FastAPI modules for responses={...} dictionaries with unusual keys.","fix":"- fastapi-code-generator: move to `0.8.1`","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:43+00:00","updated_at":"2026-11-03T20:49:43+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-03T20:49:43Z","model":"claude-haiku-5-5","output":{"fix":"- fastapi-code-generator: move to `0.8.1`","reach":"local","title":"fastapi-code-generator: crafted OpenAPI response key injects Python code","impact":"high","summary":"fastapi-code-generator turns OpenAPI files into FastAPI applications and, before 0.8.1, wrote a non-primary response status-code key into generated Python without escaping quotes. An attacker who controls that OpenAPI input can make the generated code run arbitrary Python with the privileges of the app or CI process that imports it.","audience":"developers","category":"package","nicknames":[],"who_cares":["python","fastapi","openapi","ci"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"code runs with app or CI process privileges","analyst_note":"","how_to_check":"- Check the installed version of fastapi-code-generator, for example with `pip show fastapi-code-generator`, and see whether it is below `0.8.1`.\n- Look for CI jobs or pipelines that run fastapi-code-generator on OpenAPI files from outside the team.\n- Review generated FastAPI modules for responses={...} dictionaries with unusual keys.","plain_action":"","needs_analyst":false,"not_affected_if":["version-0.8.1-or-later","trusted-openapi-only"],"who_is_affected":"Exposure requires running fastapi-code-generator (before 0.8.1) on an OpenAPI file that contains an attacker-influenced multi-response operation, and then importing the generated module. Teams that only generate code from their own trusted specs, or that already run 0.8.1 or later, are not affected by this issue. Syntax-breaking input only makes generation fail.","user_interaction":"yes","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000745,"input_tokens":4331,"output_tokens":624,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2026':13A,16A '-63469':14A,17A '0.8.1':35B,90C,217C 'addit':95C,192C 'additional-response-key':191C 'app':72B 'applic':32B,84C,171C 'arbitrari':65B 'argument':187C 'attack':53B,129C,133C 'attacker-control':128C 'attacker-influenc':132C 'break':156C 'caus':159C 'ci':18B,74B,174C 'close':142C 'code':3A,11A,25B,44B,63B,80C,99C,167C 'control':55B,130C 'craft':5A 'creat':82C 'cve':12A,15A 'decor':107C,186C 'dictionari':108C,145C 'dictionary-key':144C 'distinct':197C 'embed':118C 'escap':50B,117C 'evalu':189C 'execut':168C 'express':153C 'fail':162C 'fastapi':2A,19B,24B,31B,79C,83C 'fastapi-code-gener':1A,23B,78C 'file':29B,87C 'fix':214C 'generat':4A,26B,47B,62B,81C,92C,103C,160C,166C,180C 'import':77B,183C 'influenc':134C 'inject':9A,149C 'input':58B,157C 'insert':93C 'issu':212C 'key':8A,45B,100C,140C,146C,194C 'liter':147C 'make':60B 'modul':181C 'multi':122C 'multi-respons':121C 'non':39B,137C 'non-primari':38B,136C 'openapi':6A,20B,28B,57B,86C,124C 'oper':125C,208C 'operation-summari':207C 'packag':21B 'path':205C 'primari':40B,138C 'prior':88C 'privileg':69B,177C 'process':75B,175C 'project':200C 'python':10A,22B,48B,66B,114C,152C 'quot':51B,113C,119C 'respons':7A,41B,96C,104C,123C,139C,193C 'rout':106C,204C 'route-decor':105C 'route-path':203C 'run':64B 'second':135C 'separ':202C 'singl':112C 'single-quot':111C 'sink':195C,210C 'status':43B,98C 'status-cod':42B,97C 'string':115C 'summari':209C 'syntact':164C 'syntax':155C 'syntax-break':154C 'turn':27B 'valid':151C,165C 'version':216C 'without':49B,116C 'wrote':36B","nicknames":[],"mitigations":[],"who_affected":"Exposure requires running fastapi-code-generator (before 0.8.1) on an OpenAPI file that contains an attacker-influenced multi-response operation, and then importing the generated module. Teams that only generate code from their own trusted specs, or that already run 0.8.1 or later, are not affected by this issue. Syntax-breaking input only makes generation fail.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["ci","critical","fastapi","openapi","package","python"],"campaign_type":null,"first_public_at":"2026-07-01T09:46:01+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-63469","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63469","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":60589,"url":"https://github.com/koxudaxi/fastapi-code-generator/security/advisories/GHSA-6xmv-cjr5-w3q8","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-07-01T09:46:01+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"}