CVE-2024-52806

8.3 HIGH
XXE

📋 TL;DR

This CVE describes an XML External Entity (XXE) vulnerability in SimpleSAMLphp SAML2 library that allows attackers to read arbitrary files from the server or perform server-side request forgery when processing untrusted XML documents like SAML responses. Any application using vulnerable versions of this library for SAML authentication is affected. The vulnerability can lead to sensitive data exposure and potential server compromise.

💻 Affected Systems

Products:
  • SimpleSAMLphp SAML2 library
Versions: All versions before 4.6.14 and 5.0.0-alpha.18
Operating Systems: Any OS running PHP with SimpleSAMLphp
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default configuration when processing XML documents. Any application using the library's XML parsing functionality is vulnerable.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full server compromise through file disclosure of sensitive configuration files (database credentials, private keys) followed by remote code execution or lateral movement within the network.

🟠

Likely Case

Unauthorized access to sensitive server files including configuration files, source code, and system files, potentially leading to credential theft and further exploitation.

🟢

If Mitigated

Limited impact with proper network segmentation, file system permissions, and external entity processing disabled at system level.

🌐 Internet-Facing: HIGH - SAML authentication endpoints are typically internet-facing, allowing attackers to submit malicious SAML responses directly.
🏢 Internal Only: MEDIUM - Internal applications using SAML could still be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires ability to submit XML to the SAML processing endpoint. Complexity is medium due to need for understanding SAML protocol and XXE payloads.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.6.14 or 5.0.0-alpha.18

Vendor Advisory: https://github.com/simplesamlphp/saml2/security/advisories/GHSA-pxm4-r5ph-q2m2

Restart Required: No

Instructions:

1. Update SimpleSAMLphp SAML2 library to version 4.6.14 or 5.0.0-alpha.18. 2. Run composer update simplesamlphp/saml2. 3. Clear any PHP opcode caches. 4. Test SAML authentication functionality.

🔧 Temporary Workarounds

Disable external entity processing in PHP

PHP

Configure PHP to disable external entity loading globally

php -i | grep libxml
Add 'libxml_disable_entity_loader(true);' to application bootstrap

🧯 If You Can't Patch

  • Implement WAF rules to block XXE patterns in XML payloads
  • Use XML schema validation to reject malformed SAML responses before processing

🔍 How to Verify

Check if Vulnerable:

Check composer.json or vendor/simplesamlphp/saml2/VERSION file for version number below 4.6.14 or 5.0.0-alpha.18

Check Version:

grep -r 'simplesamlphp/saml2' composer.lock | grep version

Verify Fix Applied:

Verify version is 4.6.14 or higher, or 5.0.0-alpha.18 or higher. Test with known safe XXE payload to confirm rejection.

📡 Detection & Monitoring

Log Indicators:

  • XML parsing errors mentioning external entities
  • Unusual file access patterns from web process
  • Large XML payloads to SAML endpoints

Network Indicators:

  • XML payloads containing SYSTEM or PUBLIC declarations
  • HTTP requests to SAML endpoints with unusual Content-Type headers

SIEM Query:

source="web_logs" AND (uri="*/saml2/*" OR uri="*/sso/*") AND (message="*entity*" OR message="*XXE*" OR message="*external*" OR size>100000)

🔗 References

📤 Share & Export