Simplesamlphp Saml2 Library
The SimpleSAMLphp SAML2 library is vulnerable to an XML External Entity (XXE) attack when loading untrusted XML documents, such as the SAMLResponse. This allows an attacker to induce an XXE, potentially leading to the reading of file contents from the local file system or internal network. The `LIBXML DTDLOAD` option in the `$options` variable, defined in the `DOMDocumentFactory.php` file, enables this vulnerability. An attacker can bypass the `NONET` option by using PHP filters, such as `php://filter/convert.base64-encode/resource=http://URL` or `php://filter/convert.base64-encode/resource=FILE`, to induce network connections and steal targeted files. Remote Code Execution (RCE) may also be possible using the `php://expect` or `php://phar` wrappers, although this has not been fully tested.