CVE-2026-63720 PUBLISHED

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

Assigner: VulnCheck
Reserved: 17.07.2026 Published: 26.07.2026 Updated: 26.07.2026

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.

Metrics

CVSS Vector: 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
CVSS Score: 7.5

Product Status

Vendor koxudaxi
Product datamodel-code-generator
Versions Default: affected
  • affected from 0 to 0.70.0 (excl.)

Credits

  • Rahul Karne reporter

References

Problem Types

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