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.
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)
| Vendor | Product | Versions |
|---|---|---|
| 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
- Patch Commit product, patch
- Product product
- https://www.vulncheck.com/advisories/datamodel-code-generator-code-injection-via-unvalidated-custombasepath-schema-field third-party-advisory
- Blog Post exploit
- https://github.com/rahulreddykarne/CVE-2026-63720-datamodel-code-generator technical-description