7.5high
datamodel-code-generator Code Injection via Unvalidated customBasePath Schema Field
- Severity
- 7.5high CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.75% (higher than 56% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
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
| Product or package | Versions | Reported by |
|---|---|---|
| koxudaxi datamodel-code-generator | before 0.70.0 | CVE List |
All scores
| VulnCheck | 7.5high CVSS:4.0 | CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| VulnCheck | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
NVD (es)
datamodel-code-generator anterior a la versión 0.70.0 contiene una vulnerabilidad de inyección de código que permite a los atacantes que controlan los esquemas de entrada lograr la ejecución remota de código al proporcionar un valor customBasePath malicioso que contiene saltos de línea incrustados y una expresión Python sin puntos. El valor manipulado se emite textualmente en una instrucción from ... import ... generada sin validación de identificador, lo que provoca la ejecución de código Python arbitrario cuando se importa el módulo generado.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-63720 changed 2026-08-14 | CVE Terms of Use |
| NVD | CVE-2026-63720 changed 2026-10-24 | Public domain |