脆弱性の一覧へ戻る
編集部の見出し:datamodel-code-generator:細工したスキーマから作ったモデルの読み込みでコードを動かされる
NVD の情報
datamodel-code-generator before 0.84.0 contains a code injection vulnerability that allows attackers to achieve arbitrary code execution by supplying a malicious JSON Schema with a crafted x-python-type annotation containing a string ast.Constant node in a subscript slice position, which bypasses validation in parse_python_type_annotation and _python_type_expr_from_ast. Attackers can embed malicious Python expressions such as __import__ calls within quoted string literals in the generated source code, which Pydantic v2 evaluates as a ForwardRef via eval() during model_rebuild(), resulting in arbitrary code execution on developer workstations, CI/CD pipelines, or applications that generate and import the produced models at runtime.
- 公開日
- 2026-11-12
- 最終更新(NVD)
- 2026-11-13
- NVD の状態
- Deferred
- 脆弱性の種類
- CWE-94
深刻度(CVSS)
- 8.6 HighCVSS 4.0/副/評価:disclosure@vulncheck.com
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - 8.8 HighCVSS 3.1/副/評価:disclosure@vulncheck.com
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
悪用の状況
CISA KEV には掲載されていません(掲載されていないことは、悪用されていないことの証明ではありません)。
EPSS:今後30日に悪用される推定確率 0.37%(全体の上位 68.4%、評価日 2026-11-18)
解消方法
- datamodel-code-generator のバージョンアップ0.84.0 以降根拠:公告(編集部の転記)
「NVD の条件から推定」は、NVD が影響ありとする版の上限から読み取ったもので、修正版とは限りません。「解消方法の情報なし」は、修正が無いという意味ではありません。必ずベンダーの公告で確認してください。
編集部の記載(レポート掲載時)
レポートの編集部がベンダー公告などから転記した内容です。検証済みの値ではないため、必ず出典で確認してください。
2026-11-13 のレポートdatamodel-code-generator:細工したスキーマから作ったモデルの読み込みでコードを動かされる
8.8。
公告に記載の修正版
- datamodel-code-generator 0.84.0公告
参照(NVD)
- https://github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec
- https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.84.0
- https://www.vulncheck.com/advisories/datamodel-code-generator-code-injection-via-x-python-type-annotation
NVD から取得:2026-11-19T00:10:40.011Z/EPSS 評価日:2026-11-18
This product uses the NVD API but is not endorsed or certified by the NVD.
悪用の確認情報は CISA Known Exploited Vulnerabilities Catalog(NVD 経由で取得)によります。EPSS は FIRST(www.first.org/epss)によります。