datamodel-code-generator is vulnerable to Code Injection
78
High Risk
When generating Python models from a GraphQL schema, datamodel-code-generator renders a Union type description into a # comment using a filter that only normalizes newline characters. A bare carriage return in a regular-string description terminates the comment line, so text after it is emitted as module-level Python that executes when the generated model is imported. An attacker who controls the GraphQL schema can inject arbitrary code with no special CLI flags. The fix normalizes carriage returns in Union descriptions before rendering them as comments.
You are affected if you are using a version that falls within the vulnerable range and generate models from an untrusted GraphQL schema (--input-file-type graphql).
datamodel-code-generator is vulnerable to Code Injection in versions 0.25.0 - 0.60.0.
Upgrade the datamodel-code-generator library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant