CVE-2026-54690: datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI
42
This month
HIGH 8.2UPGRADE
CVE-2026-54690 is a high-severity flaw (CVSS 8.2) affecting datamodel-code-generator. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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.9.1 until 0.61.0, datamodel-code-generator silently dereferences attacker-controlled JSON Schema $ref HTTP or HTTPS URLs in src/datamodel_code_generator/parser/jsonschema.py through _get_ref_body, and the --allow-remote-refs gate can warn instead of blocking, allow
Why this priority
- High severity
- Public exploit reference
A fixed release or distro patch exists.
Risk facts
| CVSS score | 8.2 (High) |
| Attack vector | Network (remote) |
| Attack complexity | Low |
| Privileges needed | None |
| User interaction | Required |
| EPSS exploit chance | 0.4% (top 68%) |
| CISA exploited list | No |
| Weakness | CWE-918 |
| Published | 2026-07-28 |
| Last modified | 2026-10-23 |
Publisher (CNA): GitHub, Inc. · Vendor: koxudaxi
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
koxudaxi datamodel-code-generator UPGRADE
Affected: >= 0.9.1 and < 0.61.0
Fixed in: 0.61.0
Safe to downgrade to: a release before 0.9.1
1. Check installed version
apt-cache policy datamodel-code-generator || rpm -q datamodel-code-generator || datamodel-code-generator --version
2. UPGRADE to 0.61.0 (Debian / Ubuntu)
sudo apt update && sudo apt install --only-upgrade datamodel-code-generator
2. UPGRADE (RHEL / Amazon Linux / Fedora)
sudo dnf upgrade datamodel-code-generator
Note
Distros often backport fixes without changing the version number. Confirm with the distro advisory or changelog.
3. If no update is available yet, DOWNGRADE to a release before 0.9.1 (Debian / Ubuntu)
apt-cache madison datamodel-code-generator
sudo apt install datamodel-code-generator=<VERSION_BEFORE_0.9.1>
sudo apt-mark hold datamodel-code-generator
3. If no update is available yet, DOWNGRADE (RHEL / Amazon Linux / Fedora)
dnf --showduplicates list datamodel-code-generator
sudo dnf downgrade datamodel-code-generator-<VERSION_BEFORE_0.9.1>
sudo dnf versionlock add datamodel-code-generator
Downgrade risk
Downgrading can break dependent software and may reopen older bugs. Read the distro advisory first and test on a non-production host.
After downgrade
Restart the service, and keep the package held until a fixed release ships.
Verify at the official source NVD · CVE Program · Report a problem with this page
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Related CVEs
- CVE-2026-54653 HIGH 8.8 UPGRADE datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI
- CVE-2026-55389 HIGH 7.5 UPGRADE datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI
- CVE-2026-55391 HIGH 7.5 UPGRADE datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI
- CVE-2026-55415 HIGH 7.5 UPGRADE datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI
- CVE-2026-54656 HIGH 7.8 UPGRADE datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI