CVE-2026-54691 datamodel-code-generator vulnerable to SSRF via --url: no host/IP validation, follows redirects

High 8.2 Published Updated

Attackers can exploit the --url flag to perform server-side request forgery, accessing internal network resources and metadata services.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-54691?

CVE-2026-54691 is a high-severity server-side request forgery vulnerability in koxudaxi datamodel-code-generator, published on 28 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

datamodel-code-generator generates Python data models from schema definitions. From 0.9.1 until 0.61.0, src/datamodel_code_generator/http.py http.get_body accepts --url targets and redirect chain targets without host/IP validation, allowing server-side request forgery against loopback, private, link-local, metadata, and other network-accessible resources. This issue is fixed in version 0.61.0.

Weakness: CWE-918

Which versions are affected by CVE-2026-54691?

3 open source packages ship an affected version, including datamodel-code-generator.

PackageAffectedFixed in
datamodel-code-generator PyPIFrom 0.9.10.61.0
datamodel-code-generator PyPIFrom 0.9.10.61.0
datamodel-code-generator PyPIFrom 0.9.10.61.0

How do I fix CVE-2026-54691?

Upgrade datamodel-code-generator to 0.61.0 or later.

Upgrade, and send outbound requests through an allow-list that blocks internal addresses. More about Server-side request forgery.

Is CVE-2026-54691 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54691 exists.

Sources

Also known as GHSA-rfr2-mq9m-x2qx, MINI-x4q8-2rhc-3q8h, PYSEC-2026-3564.

Is CVE-2026-54691 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free