Improper Neutralization of Special Elements Used in a Template Engine Affecting datamodel-code-generator package, versions [0.25.0, 0.60.1)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.14% (4th 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 IDSNYK-PYTHON-DATAMODELCODEGENERATOR-18388093
  • published29 Jul 2026
  • disclosed28 Jul 2026
  • creditHamza Haroon

Introduced: 28 Jul 2026

NewCVE-2026-54621  (opens in a new tab)
CWE-1336  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

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

Overview

datamodel-code-generator is a Datamodel Code Generator

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements Used in a Template Engine via the description field in GraphQL Union types when generating Python models. An attacker can execute arbitrary Python code during import of the generated module by injecting a carriage return character into the GraphQL schema, causing attacker-controlled text to be interpreted as Python code.

CVSS Base Scores

version 4.0
version 3.1