The vulnerability (CVE-2025-47293 / GHSA-qpj9-qcwx-8jv2) is an XML External Entity (XXE) and Server-Side Request Forgery (SSRF) issue in PowSyBl Core, specifically within the com.powsybl.commons.xml.XmlReader class, though the underlying cause affected other XML parsing locations as well. The root cause was the use of XMLInputFactory (and DocumentBuilderFactory in some cases) with default configurations, which do not disable features that allow XXE and SSRF, such as processing of external DTDs and external general entities.
The XmlReader constructor (com.powsybl.commons.xml.XmlReader.<init>) would take an InputStream and create an XMLStreamReader using these insecure default settings. When methods like readContent(), readString(), or readAttribute() were subsequently called on this XmlReader instance to parse XML elements or attributes, they would use the insecurely configured XMLStreamReader. If the input XML contained malicious XXE/SSRF payloads (e.g., <!ENTITY xxe SYSTEM "file:///etc/passwd"> ... <data>&xxe;</data>), these methods would trigger the resolution of the external entities, leading to unauthorized file access or network requests.
The patch mitigates this by ensuring that all XMLInputFactory and DocumentBuilderFactory instances are created with secure configurations that disable DTD processing, external entity resolution, and access to external schemas/stylesheets. This is achieved by introducing and using centralized utility methods (XmlUtil.getXMLInputFactory() and XmlUtil.getDocumentBuilderFactory()) that enforce these secure settings. The identified vulnerable functions are the constructor of XmlReader that sets up the insecure parser with potentially malicious input, and its methods that subsequently trigger the parsing of malicious entities.