datamodel-code-generator is vulnerable to Path Traversal
75
CVE Score
High
Path Traversal
datamodel-code-generator resolves JSON Schema $ref targets that point at the local filesystem without restricting them to the input base directory and without honoring the remote-reference control. An attacker who controls an input schema can use a file:// absolute URI or a ../-escaped relative reference to read arbitrary files the process can access, bypassing --no-allow-remote-refs. Values from schema-shaped nodes are reflected verbatim into the generated Python, and failed reads act as a filesystem existence and permission oracle. The fix applies the remote-reference gate to file:// refs and rejects local refs that resolve outside the input base path.
Upgrade the datamodel-code-generator library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and generate models from an untrusted JSON Schema or OpenAPI document.
0.0.1 - 0.61.0
Fixed in 0.62.0datamodel-code-generator is vulnerable to Path Traversal in versions 0.0.1 - 0.61.0.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.