Skip to content
Heist/ feed
Back to feed
High

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-54691
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 08:05 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 28 Jul 2026, 21:29 UTC

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.

osv:CVE-2026-54691
Complete source record
{
  "id": "519c7c77b5468aac721df477d4ee2b75eb648a7acaf9bc6703f8f0fc7f74b57b",
  "url": "https://osv.dev/vulnerability/CVE-2026-54691",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "datamodel-code-generator vulnerable to SSRF via --url: no host/IP validation, follows redirects",
    "summary": "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.",
    "evidence": "osv:CVE-2026-54691",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-54691",
      "aliases": [
        "CVE-2026-54691",
        "GHSA-rfr2-mq9m-x2qx",
        "PYSEC-2026-3564"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/datamodel-code-generator/datamodel-code-generator",
              "type": "GIT",
              "events": [
                {
                  "introduced": "81a72d1a37e02fb72634a615530ca9b0656b3c5a"
                },
                {
                  "fixed": "21a25c4aa3ac6cf55c2e20e33467b95d07892602"
                },
                {
                  "fixed": "5fdba4a09f2d7a9996a504975b7ef7d63e3715bb"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0.9.1"
                      },
                      {
                        "fixed": "0.61.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "5fdba4a09f2d7a9996a504975b7ef7d63e3715bb"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "21a25c4aa3ac6cf55c2e20e33467b95d07892602"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "0.61.0"
                  }
                ]
              }
            }
          ],
          "versions": [
            "0.60.2",
            "0.60.1",
            "0.60.0",
            "0.59.1",
            "0.59.0",
            "0.58.0",
            "0.57.0",
            "0.56.1",
            "0.56.0",
            "0.55.0",
            "0.54.1",
            "0.54.0",
            "0.53.0",
            "0.52.2",
            "0.52.1",
            "0.52.0",
            "0.51.0",
            "0.50.0",
            "0.49.0",
            "0.48.0",
            "0.47.0",
            "0.46.0",
            "0.45.0",
            "0.44.0",
            "0.43.1",
            "0.43.0",
            "0.42.2",
            "0.42.1",
            "0.42.0",
            "0.41.0",
            "0.40.0",
            "0.39.0",
            "0.38.0",
            "0.37.0",
            "0.36.0",
            "0.35.0",
            "0.34.0",
            "0.33.0",
            "0.32.0",
            "0.31.2",
            "0.31.1",
            "0.31.0",
            "0.30.2",
            "0.30.1",
            "0.30.0",
            "0.29.0",
            "0.28.5",
            "0.28.4",
            "0.28.3",
            "0.28.2",
            "0.28.1",
            "0.28.0",
            "0.27.3",
            "0.27.2",
            "0.27.1",
            "0.27.0",
            "0.26.5",
            "0.26.4",
            "0.26.3",
            "0.26.2",
            "0.26.1",
            "0.26.0",
            "0.25.9",
            "0.25.8",
            "0.25.7",
            "0.25.6",
            "0.25.5",
            "0.25.4",
            "0.25.3",
            "0.25.2",
            "0.25.1",
            "0.25.0",
            "0.24.2",
            "0.24.1",
            "0.24.0",
            "0.23.0",
            "0.22.1",
            "0.22.0",
            "0.21.5",
            "0.21.4",
            "0.21.3",
            "0.21.2",
            "0.21.1",
            "0.21.0",
            "0.20.0",
            "0.19.0",
            "0.18.1",
            "0.18.0",
            "0.17.2",
            "0.17.1",
            "0.17.0",
            "0.16.1",
            "0.16.0",
            "0.15.0",
            "0.14.1",
            "0.14.0",
            "0.13.5",
            "0.13.4",
            "0.13.3",
            "0.13.2",
            "0.13.1",
            "0.13.0",
            "0.12.3",
            "0.12.2",
            "0.12.1",
            "0.12.0",
            "0.11.20",
            "0.11.19",
            "0.11.18",
            "0.11.17",
            "0.11.16",
            "0.11.15",
            "0.11.14",
            "0.11.13",
            "0.11.12",
            "0.11.11",
            "0.11.10",
            "0.11.9",
            "0.11.8",
            "0.11.7",
            "0.11.6",
            "0.11.5",
            "0.11.4",
            "0.11.3",
            "0.11.2",
            "0.11.1",
            "0.11.0",
            "0.10.3",
            "0.10.2",
            "0.10.1",
            "0.10.0",
            "0.9.4",
            "0.9.3",
            "0.9.2",
            "0.9.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-54691.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:33.614959749Z",
      "provider": "osv",
      "references": [
        "https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.61.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54691.json",
        "https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-rfr2-mq9m-x2qx",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-54691",
        "https://github.com/koxudaxi/datamodel-code-generator/commit/5fdba4a09f2d7a9996a504975b7ef7d63e3715bb"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-918"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54691.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-54691",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 501051,
  "published_at": "2026-07-28T21:29:52.197+00:00"
}