kcve.ai취약점 정보 · 내 자산 확인

CVE-2026-127208 datamodel-code-generator < 0.84.0 Code Injection via x-python-type Annotation

설명

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.

영향 받는 제품 제품 1개

  • datamodel-code-generator

    datamodel-code-generator

    해결 버전 있음

    영향 받는 버전

    • 0.84.0 미만

    해결 버전

    • 0.84.0 이상

참고 자료 3건

‹ 목록

점검 지원 범위 문의

도입 문의