Impact
OWSLib's XML parser (which supports both lxml and xml.etree) does not disable entity resolution for lxml, and could lead to arbitrary file reads from an attacker-controlled XML payload. This affects all XML parsing in the codebase.
Patches
- Use only lxml for XML handling, adding resolveentities=False to lxml's parser: https://github.com/geopython/OWSLib/pull/863
Workarounds
python patchwellknownnamespaces(etree) etree.setdefaultparser( parser=etree.XMLParser(resolveentities=False) )
References
- GHSL-2022-131
An XML external entity (XXE) injection in PyWPS before 4.4.5 allows an attacker to view files on the application server filesystem by assigning a path to the entity. OWSLib 0.24.1 may also be affected.