Koxudaxi datamodel-code-generator
datamodel-code-generator Code Injection via Unvalidated customBasePath Schema Field
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 0.70.0
Fixed in 0.70.0
Mitigation
Upgrade datamodel-code-generator to 0.70.0 or later.
References
Timeline
Days relative to CVE publicationFirst public PoC 8.3 days after publication; not in CISA KEV. First PoC: rahulreddykarne/CVE-2026-63720-datamodel-code-generator (created 3 Aug 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| rahulreddykarne/CVE-2026-63720-datamodel-code-generator | 3 Aug 2026 +8.3 d | 0 | PoC
Flags · score 15
Below the suspicion threshold (50); does not change the assessment. |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| CVE record (tagged exploit) | Blog Post | unknown | 14 Nov 2026 |
PoC characteristics
What to hunt for in your logs · from 1 PoC repoPOST /generate
- Body markers
"customBasePath":getattr(__import__('os'),'system')"type": "object"builtins import objectfrom builtins.object- Ports
- 8000
- Seen in
- 1 repo: rahulreddykarne/CVE-2026-63720-datamodel-code-generator
- Evidence
- rahulreddykarne/CVE-2026-63720-datamodel-code-generator/server/victim_service.py:8 rahulreddykarne/CVE-2026-63720-datamodel-code-generator/README.md:166 rahulreddykarne/CVE-2026-63720-datamodel-code-generator/README.md:207
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/generate(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [8000] (msg:"GG PoC-Monitor CVE-2026-63720 koxudaxi datamodel-code-generator exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/generate"; http.request_body; content:"|22|customBasePath|22|:"; http.request_body; content:"getattr(__import__('os'),'system')"; http.request_body; content:"|22|type|22|: |22|object|22|"; http.request_body; content:"builtins import object"; http.request_body; content:"from builtins.object"; reference:url,poc.griffinguard.io/cve/CVE-2026-63720; classtype:web-application-attack; sid:9624441; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: koxudaxi datamodel-code-generator exploit attempt (CVE-2026-63720)
id: gg-pocmon-cve-2026-63720-9624441
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-63720. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-63720
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/generate'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.63720