Menu

CVE-2026-63470: CVE-2026-63470: Call-Time Code Injection via Unescaped Route-Handler Docstrings in fastapi-code-generator
📰

CVE-2026-63470: CVE-2026-63470: Call-Time Code Injection via Unescaped Route-Handler Docstrings in fastapi-code-generator

DEV Community: cybersecurity·CVE Reports·7 days ago
#wIlI5kbk
#devtocybersecurity#devto#dev#code#fastapi
Reading 0:00
15s threshold

CVE-2026-63470: Call-Time Code Injection via Unescaped Route-Handler Docstrings in fastapi-code-generator

Vulnerability ID: CVE-2026-63470

CVSS Score: 9.3

Published: 2026-11-09

CVE-2026-63470 (GHSA-h667-4jj2-cgv4) is a code injection vulnerability (CWE-94) in fastapi-code-generator prior to version 0.8.1. The tool generates FastAPI route handlers by directly interpolating the OpenAPI Operation.summary field into triple-double-quoted Python docstrings without escaping embedded triple quotes or backslashes. An attacker who supplies or modifies an OpenAPI specification can break out of the docstring literal and inject arbitrary Python expressions into the generated route handler body, resulting in remote code execution when the affected HTTP endpoint is called.

TL;DR

fastapi-code-generator versions prior to 0.8.1 fail to escape triple-double quotes when inserting OpenAPI Operation.summary strings into generated Python docstrings.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.