Koxudaxi datamodel-code-generator
Arbitrary local file read via XSD `schemaLocation` (`xs:include`/`xs:import`) path traversal, with no remote-ref gate
datamodel-code-generator generates Python data models from schema definitions. From 0.59.0 until 0.62.0, XML Schema parsing in src/datamodel_code_generator/parser/xmlschema.py for --input-file-type xmlschema resolves xs:include, xs:import, xs:redefine, and xs:override schemaLocation values outside the input base path, allowing arbitrary local files to be read and reflected into generated models. This issue is fixed in version 0.62.0.
First public PoC
None yetno public PoC found
Public PoCs00 on GitHub
CVSS7.5high · scored by CNA · CWE-22
CISA KEV
Not listednot known exploited
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
koxudaxi datamodel-code-generator
- >= 0.59.0, < 0.62.0
Fixed in 0.62.0
Mitigation
Upgrade datamodel-code-generator to 0.62.0 or later.
References
- Vendor advisory github.com/koxudaxi/datamodel-code-generator/s…
- Patch github.com/koxudaxi/datamodel-code-generator/c…
- Release notes github.com/koxudaxi/datamodel-code-generator/r…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.