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.
Published: 2026-07-28
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability arises from datamodel‑code‑generator's http.get_body function, which accepts a --url parameter without validating the host or IP address. The function follows redirects, allowing an attacker to target internal network resources such as loopback, private, link‑local, or metadata IPs. This flaw is an instance of CWE‑918, a server‑side request forgery that can lead to unintended disclosure of internal data or, in some scenarios, execution of code on the internal network if the target service processes malicious content.

Affected Systems

Affected products are koxudaxi's datamodel‑code‑generator. All releases from version 0.9.1 through 0.60.x contain the flaw; the issue is fixed starting with 0.61.0. Users running any earlier version and supplying a --url argument are vulnerable.

Risk and Exploitability

The CVSS base score of 8.2 marks the flaw as high severity, while the EPSS score of less than 1% indicates a low likelihood of exploitation at present, and the vulnerability is not listed in the CISA KEV catalog. However, because the tool can be invoked by an attacker who can supply arbitrary URLs, an adversary able to run the generator on a shared environment could conduct internal reconnaissance or launch further attacks by directing the generator to sensitive internal services. Upgrading to 0.61.0 removes the lack of host/IP validation and mitigates all known risks.

Generated by OpenCVE AI on August 3, 2026 at 14:12 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade datamodel‑code‑generator to version 0.61.0 or later, which restores host and IP validation.
  • Restrict the --url flag to trusted input by implementing input validation or a whitelist of allowed domains before invoking the generator.
  • Run the generator in an isolated network context, such as a container with limited outbound access, until the update is applied.

Generated by OpenCVE AI on August 3, 2026 at 14:12 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-rfr2-mq9m-x2qx datamodel-code-generator vulnerable to SSRF via --url: no host/IP validation, follows redirects
History

Wed, 29 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 28 Jul 2026 23:45:00 +0000

Type Values Removed Values Added
First Time appeared Koxudaxi
Koxudaxi datamodel-code-generator
Vendors & Products Koxudaxi
Koxudaxi datamodel-code-generator

Tue, 28 Jul 2026 22:00:00 +0000

Type Values Removed Values Added
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.
Title datamodel-code-generator vulnerable to SSRF via --url: no host/IP validation, follows redirects
Weaknesses CWE-918
References
Metrics cvssV3_1

{'score': 8.2, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N'}


Subscriptions

Koxudaxi Datamodel-code-generator
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-29T14:18:45.531Z

Reserved: 2026-06-15T22:58:06.562Z

Link: CVE-2026-54691

cve-icon Vulnrichment

Updated: 2026-07-29T14:18:35.827Z

cve-icon NVD

Status : Deferred

Published: 2026-07-28T22:17:40.800

Modified: 2026-07-30T20:02:44.977

Link: CVE-2026-54691

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T14:15:05Z

Weaknesses
  • CWE-918

    Server-Side Request Forgery (SSRF)