PT-2026-65613 · Pypi · Datamodel-Code-Generator

CVE-2026-54691

·

Published

2026-07-28

·

Updated

2026-07-28

CVSS v3.1

8.2

High

VectorAV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
Name of the Vulnerable Software and Affected Versions datamodel-code-generator versions 0.9.1 through 0.60.1
Description The get body() function in src/datamodel code generator/http.py fails to validate host or IP addresses when processing targets provided via the --url argument or through redirect chains. This allows server-side request forgery (SSRF), where an attacker can force the application to make requests to loopback, private, link-local (such as cloud metadata services at 169.254.169.254), or other internal network resources. Because the tool follows redirects unconditionally and only filters out text/html content, non-HTML responses from internal APIs or services are parsed as schemas and embedded into the generated Python source files, potentially exfiltrating sensitive internal data to anyone with access to the output files.
Recommendations Update datamodel-code-generator to version 0.61.0. As a temporary mitigation, avoid using the --url argument with untrusted URLs or restrict the environment's network access to prevent requests to internal resources.

Fix

SSRF

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2026-54691
GHSA-RFR2-MQ9M-X2QX

Affected Products

Datamodel-Code-Generator