Skip to content
OpenAdvisories
High · 7.5 CVE-2026-55391 EUVD-2026-50076GHSA-vx7x-vcc2-c44gPYSEC-2026-3565

datamodel-code-generator vulnerable to SSRF protection bypass via DNS rebinding

Published Jul 28, 2026 · Updated Jul 29, 2026 · Assigned by GitHub_M

Description

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. Prior to 0.63.0, datamodel-code-generator validates a URL host once in src/datamodel_code_generator/http.py through get_body, _validate_url_for_fetch, and _get_ips_from_host, but then lets httpx resolve the host again for the connection, allowing DNS rebinding to bypass allow_private_network=False and reach internal services. This issue is fixed in version 0.63.0.

Affected products

VendorProductAffectedFixed
koxudaxi datamodel-code-generator < 0.63.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-datamodel-code-generator 0.72.3-1.1 openSUSE-SU-2026:11538-1

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI datamodel-code-generator < 0.63.0 0.63.0 GHSA-vx7x-vcc2-c44g

Advisories 1

References