CVE-2025-66568: Ruby saml Ruby-saml Allows A Libxml2 Canonicalization Vulnerability
CRITICALCVE-2025-66568 is a CRITICAL ruby-saml allows a libxml2 canonicalization vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Ruby saml libraries in the RubyGems ecosystem. The issue involves ruby-saml allows a libxml2 canonicalization error to bypass digest/signature validation. Remediation is available by upgrading affected packages to version 1.18.0.
CVE-2025-66568 at a Glance
How to Fix CVE-2025-66568
To remediate this vulnerability, upgrade all affected Ruby saml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade ruby-saml to 1.18.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for ruby-saml
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-66568, inspect your project dependencies for Ruby saml:
inspect dependencies for ruby-saml
Analyze the terminal output to locate any version of Ruby saml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.18.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Ruby saml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-66568 Affected Ruby saml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ruby-saml
|
RubyGems |
< 1.18.0
|
1.18.0
|
References
Frequently Asked Questions
What is CVE-2025-66568?
Which Ruby saml versions are affected?
What version fixes CVE-2025-66568?
Is ruby-saml affected?
What CWE is associated with CVE-2025-66568?
How can I check RubyGems dependencies for CVE-2025-66568?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x4h9-gwv3-r4m4",
"modified" : "2025-12-12T21:52:40Z",
"published" : "2025-12-08T22:03:19Z",
"aliases" : [ "CVE-2025-66568" ],
"summary" : "Ruby-saml allows a Libxml2 Canonicalization error to bypass Digest/Signature validation",
"details" : "### Summary\nRuby-saml up to and including 1.12.4, there is an authentication bypass vulnerability because of an issue at libxml2 canonicalization process used by Nokogiri for document transformation. That allows an attacker to be able to execute a Signature Wrapping attack. The vulnerability does not affect the version 1.18.0.\n\n### Details\nWhen libxml2’s canonicalization is invoked on an invalid XML input, it may return an empty string rather than a canonicalized node. ruby-saml then proceeds to compute the DigestValue over this empty string, treating it as if canonicalization succeeded.\n\n### Impact\n1. Digest bypass: By crafting input that causes canonicalization to yield an empty string, the attacker can manipulate validation to pass incorrectly.\n\n2. Signature replay on empty canonical form: If an empty string has been signed once (e.g., in a prior interaction or via a misconfigured flow), that signature can potentially be replayed to bypass authentication.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "ruby-saml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.18.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/SAML-Toolkits/ruby-saml/security/advisories/GHSA-x4h9-gwv3-r4m4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66568"
}, {
"type" : "WEB",
"url" : "https://github.com/SAML-Toolkits/ruby-saml/commit/acac9e9cc0b9a507882c614f25d41f8b47be349a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/SAML-Toolkits/ruby-saml"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/ruby-saml/CVE-2025-66568.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-347" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2025-12-08T22:03:19Z",
"nvd_published_at" : "2025-12-09T16:18:21Z"
}
}