Intel

AIKIDO-2026-895780

fastapi-code-generator is vulnerable to Code Injection

CVE-2026-63470Published 3 days ago
November 4, 2026

93

CVE Score

Critical

Code Injection

Are you affected? Scan for Free

TL;DR

Before the fix, fastapi-code-generator wrote the OpenAPI operation summary into the generated route handler's docstring without escaping, so a summary containing triple double quotes closed the docstring and injected Python expression statements that run with the app's privileges whenever the generated endpoint is called. Whoever supplies the OpenAPI document that parse_info and the operation model read can plant this code; it runs in any app generated from that document and deployed. The fix escapes backslashes and triple double quotes in the summary at parse time, so the docstring can no longer be broken out of.

How do I fix this?

Upgrade the fastapi-code-generator package to 0.8.1 or later.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and generate code from an OpenAPI document supplied by someone outside your development team and deploy the generated app.

Versions

0.0.18 - 0.8.0

Fixed in 0.8.1

Background info

fastapi-code-generator is vulnerable to Code Injection in versions 0.0.18 - 0.8.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea