datamodel-code-generator Vulnerability: Schema-Driven Code Execution
An early warning has been issued regarding a potential vulnerability in the datamodel-code-generator package that could allow arbitrary Python code execution through malicious input schemas.
What happened
Reports indicate that the datamodel-code-generator package may be susceptible to a schema-content-driven remote code execution vulnerability. This vulnerability appears to enable the execution of arbitrary Python code on the machine that imports the generated model, if a malicious input schema is used. The affected versions range from 0.17.0 to 0.60.1, with fixes available in version 0.60.2 and later. It is recommended to avoid using untrusted input schemas with the datamodel-code-generator package until a fix is confirmed and applied. For detailed version information and fixes, consult the primary sources.
How 0Day mitigates this
datamodel-code-generator is anywhere in your dependency tree, the engineers who own the affected repositories get a push alert the moment it is flagged — no manual audit to remember to run.Read how this differs from waiting on a scanner to catch a known advisory, or see the exact, read-only access 0Day needs to do this for an organization.