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.
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)
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | simplesamlphp/saml2 | < 4.6.14 | 4.6.14 |
| Composer package | simplesamlphp/saml2-legacy | < 4.6.14 | 4.6.14 |
References
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L- Weakness (CWE)
CWE-611- Platform
- Composer
- Package
simplesamlphp/saml2, simplesamlphp/saml2-legacy- Disclosed
- 02.12.2024
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-pxm4-r5ph-q2m2 - CC BY 4.0
Vulnerability history: simplesamlphp/saml2
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 9
- First → latest
- 05.2022 07.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 7
- Medium 1
Disclosures per year
- 2022: 4
- 2023: 1
- 2024: 1
- 2025: 1
- 2026: 2
-
SimpleSAMLphp SAML2 has an XXE in parsing SAML messages this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.