datamodel-code-generator is vulnerable to Path Traversal
75
CVE Score
High
Path Traversal
When generating models from an XML Schema, datamodel-code-generator resolves the schemaLocation attribute on xs:include, xs:import, xs:redefine, and xs:override against the source directory and reads the target with only an existence check. An attacker who controls the input XSD can use ../ traversal or an absolute path to read files outside the input base directory, and schema-shaped contents are folded into the generated code. Unlike the JSON Schema $ref path there is no remote-reference gate, so disabling remote references does not block it. The fix rejects schemaLocation targets 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 XML Schema (--input-file-type xmlschema).
0.59.0 - 0.61.0
Fixed in 0.62.0datamodel-code-generator is vulnerable to Path Traversal in versions 0.59.0 - 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.