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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| koxudaxi | datamodel-code-generator | < 0.70.0 | 0.70.0 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-datamodel-code-generator | 0.72.3-1.1 | openSUSE-SU-2026:11538-1 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
rahulreddykarne/CVE-2026-63720-datamodel-code-generator ★ 0 · Aug 3, 2026
Code injection (RCE) in datamodel-code-generator via unvalidated customBasePath (CVE-2026-63720)
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 1
- openSUSE-SU-2026:11538-1 python313-datamodel-code-generator-0.72.3-1.1 on GA media SUSE / openSUSE Security Updates · Aug 19, 2026
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