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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| 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.
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-datamodel-code-generator | 0.72.3-1.1 | openSUSE-SU-2026:11538-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | datamodel-code-generator | < 0.63.0 | 0.63.0 | GHSA-vx7x-vcc2-c44g |
Advisories 1
- openSUSE-SU-2026:11538-1 python313-datamodel-code-generator-0.72.3-1.1 on GA media SUSE / openSUSE Security Updates · Aug 19, 2026