PyPI (Python)Worst: High13 advisories

datamodel-code-generator: known vulnerabilities

datamodel-code-generator has 13 reviewed security advisories in the GitHub Advisory Database — 12 high, 1 low. The most recent was published 2026-10-08. Each one below lists the affected version range, the release that fixes it, its CVE and severity. SkyShield matches these against the datamodel-code-generator versions running across your servers, containers and images, and ranks what to patch first.

How to fix datamodel-code-generator

Upgrade datamodel-code-generator to a release at or above the fixed version shown for each advisory below. For PyPI (Python):

pip install --upgrade datamodel-code-generator (pin datamodel-code-generator>=0.81.0)

SkyShield checks the installed version on every machine and container, so you can see which hosts are still on an affected release after you roll the fix out.

Advisories (13)

datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory High 7.5 CWE-22 CWE-73 — Affected: from 0.59.0 up to 0.81.0. Fixed in 0.81.0. Published 2026-10-08. GHSA-77xj-x4rm-935c · CVE-2026-107377
`datamodel-code-generator` vulnerable to code injection in via attacker-controlled `default_factory` schema field High 8.8 CWE-1336 CWE-94 — Affected: from 0.17.0 up to 0.60.2. Fixed in 0.60.2. Published 2026-07-28. GHSA-386q-5hp3-95m9 · CVE-2026-54653
datamodel-code-generator vulnerable to arbitrary local file read via XSD `schemaLocation` (`xs:include`/`xs:import`) path traversal, with no remote-ref gate High 7.5 CWE-200 CWE-22 CWE-610 — Affected: from 0.59.0 up to 0.62.0. Fixed in 0.62.0. Published 2026-07-28. GHSA-442q-2j6p-642g · CVE-2026-55390
datamodel-code-generator vulnerable to code injection via `x-python-import` / `customTypePath` in generated import statements High 7.5 CWE-94 CWE-95 — Affected: from 0.11.6 up to 0.64.0. Fixed in 0.64.0. Published 2026-07-28. GHSA-5578-w22f-pfx9 · CVE-2026-55415
datamodel-code-generator vulnerable to arbitrary local file read via JSON-Schema `$ref` (`file://` and `../` traversal), bypassing `--no-allow-remote-refs` High 7.5 CWE-200 CWE-22 CWE-610 — Affected: before 0.62.0. Fixed in 0.62.0. Published 2026-07-28. GHSA-8359-h9fx-j6v9 · CVE-2026-55389
`datamodel-code-generator` vulnerable to code execution on import via unescaped `validators` entries in --extra-template-data High 7.8 CWE-94 — Affected: from 0.52.1 up to 0.60.2. Fixed in 0.60.2. Published 2026-07-28. GHSA-8m8r-38jm-f355 · CVE-2026-54656
datamodel-code-generator vulnerable to SSRF via JSON-Schema `$ref` to HTTP URL (silent by default) High 8.2 CWE-918 — Affected: from 0.9.1 up to 0.61.0. Fixed in 0.61.0. Published 2026-07-28. GHSA-954p-556p-r752 · CVE-2026-54690
`datamodel-code-generator` vulnerable to code injection via unescaped carriage return in GraphQL Union description High 7.8 CWE-1336 CWE-94 — Affected: from 0.25.0 up to 0.60.1. Fixed in 0.60.1. Published 2026-07-28. GHSA-j884-q54q-mmx3 · CVE-2026-54621
`datamodel-code-generator` vulnerable to code execution on import via `x-python-type` JSON-Schema extension in datamodel-code-generator High 7.8 CWE-94 — Affected: from 0.51.0 up to 0.60.2. Fixed in 0.60.2. Published 2026-07-28. GHSA-m34r-v34r-rf9q · CVE-2026-54655
datamodel-code-generator: Authorization / request headers leaked to cross-origin redirect target when fetching remote schemas Low 3.7 CWE-200 CWE-601 — Affected: before 0.63.0. Fixed in 0.63.0. Published 2026-07-28. GHSA-r5vv-ff45-prp2 · CVE-2026-55403
datamodel-code-generator vulnerable to SSRF via --url: no host/IP validation, follows redirects High 8.2 CWE-918 — Affected: from 0.9.1 up to 0.61.0. Fixed in 0.61.0. Published 2026-07-28. GHSA-rfr2-mq9m-x2qx · CVE-2026-54691
datamodel-code-generator vulnerable to SSRF protection bypass via DNS rebinding High 7.5 CWE-350 CWE-367 CWE-918 — Affected: before 0.63.0. Fixed in 0.63.0. Published 2026-07-28. GHSA-vx7x-vcc2-c44g · CVE-2026-55391
`datamodel-code-generator` vulnerable to code injection via unescaped carriage return in `--extra-template-data` `comment` field High 7.8 CWE-1336 CWE-94 — Affected: from 0.14.1 up to 0.60.2. Fixed in 0.60.2. Published 2026-07-28. GHSA-wjv6-jcfj-mf9r · CVE-2026-54654

Find datamodel-code-generator across your fleet

Install one agent per server and connect your cloud. SkyShield matches your packages and images against GHSA, CISA KEV and EPSS and shows the fix per machine. Free for one server, then from $49 per server a month. Start free.