datamodel-code-generator < 0.84.0 Code Injection via x-python-type Annotation
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||
|---|---|---|---|---|---|---|---|---|---|
| datamodel-code-generator | datamodel-code-generator | unaffected |
|
No data.
No data.
| Vendor | Product | Versions | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Datamodel-code-generator | Datamodel-code-generator |
|
No CVSS v3.0
No CVSS v2
This CVE is not in the KEV list.
Exploit prediction score: < 1% (0.371% probability within 30 days)
Key SSVC decision points have not yet been added.
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Datamodel-code-generator
Datamodel-code-generator datamodel-code-generator |
|
| Vendors & Products |
Datamodel-code-generator
Datamodel-code-generator datamodel-code-generator |
| Type | Values Removed | Values Added |
|---|---|---|
| Description | 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. | |
| Title | datamodel-code-generator < 0.84.0 Code Injection via x-python-type Annotation | |
| Weaknesses | CWE-94 | |
| References |
|
|
| Metrics |
cvssV3_1
|