Arbitrary Code Injection Affecting datamodel-code-generator package, versions [,0.70.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.75% (53rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-DATAMODELCODEGENERATOR-18313114
  • published26 Jul 2026
  • disclosed26 Jul 2026
  • creditRahul Karne

Introduced: 26 Jul 2026

CVE-2026-63720  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade datamodel-code-generator to version 0.70.0 or higher.

Overview

datamodel-code-generator is a Datamodel Code Generator

Affected versions of this package are vulnerable to Arbitrary Code Injection via the customBasePath schema field. An attacker can execute arbitrary Python code by supplying a specially crafted value containing embedded newlines and a dot-free Python expression, which is inserted verbatim into a generated import statement without proper validation. This code is then executed when the generated module is imported.

CVSS Base Scores

version 4.0
version 3.1