Intel

AIKIDO-2026-971188

datamodel-code-generator is vulnerable to Server-Side Request Forgery (SSRF)

CVE-2026-54691Published Jun 18, 2026
June 18, 2026

82

CVE Score

High

Server-Side Request Forgery (SSRF)

Are you affected? Scan for Free

TL;DR

The datamodel-code-generator HTTP fetcher loads schemas from URLs passed via --url without validating hosts or redirect targets. With the [http] extra installed, an attacker who can influence the URL can reach loopback, private, link-local, or cloud metadata endpoints and reflect responses into generated Python source. Before the fix, redirects were followed unconditionally and only HTML responses were filtered. The patch validates HTTP(S) URLs, blocks non-public network targets by default, validates each redirect, and requires explicit opt-in for private network access.

How do I fix this?

Upgrade the datamodel-code-generator library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and have installed the [http] extra.

Versions

0.9.1 - 0.60.2

Fixed in 0.61.0

Background info

datamodel-code-generator is vulnerable to Server-Side Request Forgery (SSRF) in versions 0.9.1 - 0.60.2.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea