Vulnerability · Published Jul 26, 2026 · Assigned by VulnCheck

CVE-2026-63720datamodel-code-generator Code Injection via Unvalidated customBasePath Schema Field

High 7.5

In plain English

A high-severity code injection in datamodel-code-generator from koxudaxi. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 55% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)0.7%top 45.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official description

datamodel-code-generator prior to version 0.70.0 contains a code injection vulnerability that allows attackers who control input schemas to achieve remote code execution by supplying a malicious customBasePath value containing embedded newlines and a dot-free Python expression. The crafted value is emitted verbatim into a generated 'from ... import ...' statement without identifier validation, causing arbitrary Python code to execute when the generated module is imported.

Affected products (as reported)

VendorProductVersions
koxudaxi datamodel-code-generator 0 – before 0.70.0

Weakness: CWE-94 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

References