CVE-2026-63720

datamodel-code-generator Code Injection via Unvalidated customBasePath Schema Field

State
Published
Severity
7.5 High
Published
Jul 26, 2026
Updated
Aug 14, 2026
Reserved
Jul 17, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.07.5 HighCVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NVulnCheck
3.17.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:HVulnCheck

Weaknesses

  • CWE-94 Improper Control of Generation of Code ('Code Injection')

Affected Products

ProductVersions
datamodel-code-generatorkoxudaxi
  • before 0.70.0Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.