CVE-2025-66578
📋 TL;DR
CVE-2025-66578 is an authentication bypass vulnerability in xmlseclibs PHP library versions 3.1.3 and earlier. When processing invalid XML input during canonicalization, the library incorrectly accepts empty string outputs as valid, allowing attackers to bypass XML signature validation. This affects any PHP application using xmlseclibs for XML encryption or signature verification.
💻 Affected Systems
- xmlseclibs
📦 What is this software?
Xmlseclibs by Xmlseclibs Project
⚠️ Risk & Real-World Impact
Worst Case
Complete authentication bypass allowing unauthorized access to protected systems or data, potentially leading to data theft, privilege escalation, or system compromise.
Likely Case
Authentication bypass in applications relying on XML signatures for security decisions, potentially allowing unauthorized API access or privilege escalation.
If Mitigated
Limited impact with proper input validation and error handling in place, potentially causing validation failures rather than bypasses.
🎯 Exploit Status
Exploitation requires crafting invalid XML input that triggers the canonicalization failure condition.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.1.4
Vendor Advisory: https://github.com/robrichards/xmlseclibs/security/advisories/GHSA-c4cc-x928-vjw9
Restart Required: No
Instructions:
1. Update xmlseclibs to version 3.1.4 or later using composer: composer require robrichards/xmlseclibs:^3.1.4
2. Verify the update completed successfully
3. Test XML signature validation functionality
🔧 Temporary Workarounds
Add canonicalization failure check
allModify XMLSecurityDSig.php to treat canonicalization failures as fatal errors
Edit line 296 in XMLSecurityDSig.php to add explicit check for empty/nil canonicalization output
🧯 If You Can't Patch
- Implement additional XML input validation before canonicalization
- Add application-level checks to verify canonicalization succeeded before proceeding
🔍 How to Verify
Check if Vulnerable:
Check composer.json or installed packages for xmlseclibs version 3.1.3 or earlier
Check Version:
composer show robrichards/xmlseclibs | grep version
Verify Fix Applied:
Verify xmlseclibs version is 3.1.4 or later and test with invalid XML input that previously triggered the issue
📡 Detection & Monitoring
Log Indicators:
- XML parsing errors followed by successful authentication
- Unexpected canonicalization failures
Network Indicators:
- Malformed XML payloads to authentication endpoints
SIEM Query:
source="application_logs" AND ("xmlseclibs" OR "canonicalization") AND ("error" OR "failure") AND "authentication"