Server-side Request Forgery (SSRF) Affecting datamodel-code-generator package, versions [0.9.1, 0.61.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.21% (12th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Server-side Request Forgery (SSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-DATAMODELCODEGENERATOR-18388104
  • published29 Jul 2026
  • disclosed28 Jul 2026
  • creditHamza Haroon

Introduced: 28 Jul 2026

NewCVE-2026-54691  (opens in a new tab)
CWE-918  (opens in a new tab)

How to fix?

Upgrade datamodel-code-generator to version 0.61.0 or higher.

Overview

datamodel-code-generator is a Datamodel Code Generator

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) in the get_body function when processing URLs provided via the --url argument, as there is no validation of host or IP addresses and redirects are followed unconditionally. An attacker can access internal network resources and exfiltrate sensitive information by supplying a crafted URL that redirects to internal or cloud metadata endpoints, causing their responses to be embedded in generated source files.

Note: This is only exploitable if the [http] extra is installed and the tool is run with an untrusted or attacker-controlled URL.

CVSS Base Scores

version 4.0
version 3.1