Executive brief
Unstructured is a popular Python library for parsing and processing unstructured data including XML documents. The library's XML parser was vulnerable to XML External Entity (XXE) attacks, which could allow an attacker to read local files or cause denial of service by processing maliciously crafted XML documents. This affects any application using the library to parse untrusted XML input.
Technical details
The vulnerability is a classic XML External Entity (XXE) injection in the XMLParser component of the Unstructured library (CWE-611). The root cause was that the lxml parser was not configured to disable entity resolution, allowing external entities to be processed during XML parsing. The vulnerability requires no authentication and can be triggered over the network by sending a malicious XML file to the partition_xml function. An attacker can exploit this to read arbitrary local files (information disclosure) or perform denial-of-service attacks. The fix, released in version 0.14.3, sets resolve_entities=False when parsing XML to prevent external entity processing.
Affected products
- Unstructured-IO unstructured 0.14.2 and earlier
Timeline
- 2024-12-09: disclosed
- 2024-12-09: patched: Fixed in version 0.14.3