CVE-2024-52806: SimpleSAMLphp SAML2 has an XXE in parsing SAML messages
Summary When loading an (untrusted) XML document, for example the SAMLResponse, it's possible to induce an XXE. $options is defined as: https://github.com/simplesamlphp/saml2/blob/717c0adc4877ebd58428637e5626345e59fa0109/src/SAML2/DOMDocumentFactory.php#L41 including the DTDLoad option, which allows an attacker to read file contents from local file system OR internal network.
Published Dec 2, 2024 · Updated Dec 13, 2024
Affected packages
simplesamlphp/saml2
- Ecosystem
- Composer (PHP)
- Affected
- < 4.6.14
- Fixed in
- 4.6.14
- Check
composer show simplesamlphp/saml2
simplesamlphp/saml2-legacy
- Ecosystem
- Composer (PHP)
- Affected
- < 4.6.14
- Fixed in
- 4.6.14
- Check
composer show simplesamlphp/saml2-legacy
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
When loading an (untrusted) XML document, for example the SAMLResponse, it's possible to induce an XXE.
$options is defined as: https://github.com/simplesamlphp/saml2/blob/717c0adc4877ebd58428637e5626345e59fa0109/src/SAML2/DOMDocumentFactory.php#L41 including the DTDLoad option, which allows an attacker to read file contents from local file system OR internal network.
While there is the NONET option, an attacker can simply bypass if by using PHP filters: php://filter/convert.base64-encode/resource=http://URL OR FILE
From there an attacker can induce network connections and steal the targeted file OOB (haven't fully tested this).
RCE may be possible with the php://expect or php://phar wrappers, but this hasn't been tested.
Note: The mitigation here: https://github.com/simplesamlphp/saml2/blob/717c0adc4877ebd58428637e5626345e59fa0109/src/SAML2/DOMDocumentFactory.php#L63-L69 Comes too late, as the XML has already been loaded into a document. Mitigation:
Remove the LIBXML_DTDLOAD | LIBXML_DTDATTR options. Additionally, as a defense in depth measure, check if there is the string: <!DOCTYPE inside the XML before parsing it. (This is not a complete fix because someone may be able to exploit some parser differentials, to load a DOCTYPE, maybe through spacing like: <! DOCTYPE)
Credited to ahacker1-securesaml.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesCVE-2026-110782
SAML2: Incomplete fix of CVE-2026-49283: unsigned embedded Response bypasses HTTP-Artifact signature verification (no embedded-Issuer binding)
high8.7Nov 17, 2026CVE-2026-49283
SimpleSAMLphp HTTP-Artifact TLS validator confusion allows cross-IdP authentication bypass
high8.7Jul 2, 2026CVE-2026-49289
SimpleSAMLphp has Possible DoS via XPath Transform
high7.5Jul 2, 2026CVE-2025-27773
The SimpleSAMLphp SAML2 library incorrectly verifies signatures for HTTP-Redirect binding
high8.6Mar 11, 2025
