Skip to content
Fencer Vulns
high 7.5

CVE-2026-55415 json

datamodel-code-generator vulnerable to code injection via `x-python-import` / `customTypePath` in generated import statements

published 2026-07-28 3 mo ago modified 2026-10-23 16 d ago also GHSA-5578-w22f-pfx9 , PYSEC-2026-3557 , EUVD-2026-50073

cvss
7.5
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.5%
EPSS 0.5% chance of exploitation in 30 days, percentile 42%
public exploits
0
none known

Summary

datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON, YAML, or CSV. From 0.11.6 until 0.64.0, datamodel-code-generator allows attacker-controlled x-python-import or customTypePath schema extensions to reach src/datamodel_code_generator/parser/jsonschema.py and generated import handling through Import.from_full_path and Imports.create_line in src/datamodel_code_generator/imports.py, allowing a newline to break out of an import statement and execute Python code when the generated model is imported. This issue is fixed in version 0.64.0.

Patch / fix

  • pypi datamodel-code-generator 0.64.0
  • koxudaxi datamodel-code-generator 0.64.0

CISA SSVC

Exploitation
Proof of concept is public
Automatable
no
Technical impact
total
Assessed
3 mo ago

Exploit prediction

0.49% chance of exploitation in the next 30 days, higher than 42% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-5578-w22f-pfx9 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 7.5 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub 3.1 7.5 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
OSV 3.1 7.5 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi datamodel-code-generator
>=0.11.6, <0.64.0
0.64.0

Affected products

  • koxudaxi datamodel-code-generator

Classification

Weakness
  • CWE-94 Improper Control of Generation of Code
  • CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.