---
id: CVE-2026-63720
title: >-
  datamodel-code-generator prior to version 0.70.0 contains a code injection
  vulnerability that allows attackers who control input schemas to achieve
  remote code execution by supplying a malicious customBasePath value containing
  embedded n…
summary: >-
  datamodel-code-generator prior to version 0.70.0 contains a code injection
  vulnerability that allows attackers who control input schemas to achieve
  remote code execution by supplying a malicious customBasePath value containing
  embedded n…
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'
cwe:
  - CWE-94
published: '2026-07-26'
updated: '2026-07-26'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-63720'
references:
  - url: 'https://github.com/koxudaxi/datamodel-code-generator'
    label: disclosure@vulncheck.com
  - url: 'https://github.com/koxudaxi/datamodel-code-generator/commit/545a96c5'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/datamodel-code-generator-code-injection-via-unvalidated-custombasepath-schema-field
    label: disclosure@vulncheck.com
tags:
  - nvd
  - exploit-available
ingestedAt: '2026-07-26T11:12:03.164Z'
epss: 0.00737
epssPercentile: 0.52563
exploits:
  github: 1
  githubRepos:
    - 'https://github.com/rahulreddykarne/CVE-2026-63720-datamodel-code-generator'
  checkedAt: '2026-09-26T09:05:55.081Z'
exploitAvailable: true
---

## Overview

datamodel-code-generator prior to version 0.70.0 contains a code injection vulnerability that allows attackers who control input schemas to achieve remote code execution by supplying a malicious customBasePath value containing embedded newlines and a dot-free Python expression. The crafted value is emitted verbatim into a generated 'from ... import ...' statement without identifier validation, causing arbitrary Python code to execute when the generated module is imported.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
