{"id":"CVE-2025-25291","published":"2025-03-12T20:16:12Z","modified":"2025-11-03T19:44:59Z","title":"ruby-saml vulnerable to SAML authentication bypass due to DOCTYPE handling (parser differential)","vendor":"SAML-Toolkits","product":"ruby-saml","tier":"tail","description":{"text":"ruby-saml provides security assertion markup language (SAML) single sign-on (SSO) for Ruby. An authentication bypass vulnerability was found in ruby-saml prior to versions 1.12.4 and 1.18.0 due to a parser differential. ReXML and Nokogiri parse XML differently; the parsers can generate entirely different document structures from the same XML input. That allows an attacker to be able to execute a Signature Wrapping attack. This issue may lead to authentication bypass. Versions 1.12.4 and 1.18.0 fix the issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.3,"severity":"CRITICAL","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.20965,"percentile":0.97559,"provenance":"source"},"cwes":[{"id":"CWE-347","name":"Improper Verification of Cryptographic Signature"},{"id":"CWE-436","name":"Interpretation Conflict"}],"references":[{"url":"https://github.com/SAML-Toolkits/ruby-saml/security/advisories/GHSA-4vc4-m8qh-g8jm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/omniauth/omniauth-saml/security/advisories/GHSA-hw46-3hmr-x9xv","tags":["x_refsource_MISC"]},{"url":"https://github.com/SAML-Toolkits/ruby-saml/commit/e76c5b36bac40aedbf1ba7ffaaf495be63328cd9","tags":["x_refsource_MISC"]},{"url":"https://github.com/SAML-Toolkits/ruby-saml/commit/e9c1cdbd0f9afa467b585de279db0cbd0fb8ae97","tags":["x_refsource_MISC"]},{"url":"https://about.gitlab.com/releases/2025/03/12/patch-release-gitlab-17-9-2-released","tags":["x_refsource_MISC"]},{"url":"https://github.blog/security/sign-in-as-anyone-bypassing-saml-sso-authentication-with-parser-differentials","tags":["x_refsource_MISC"]},{"url":"https://github.com/SAML-Toolkits/ruby-saml/releases/tag/v1.12.4","tags":["x_refsource_MISC"]},{"url":"https://github.com/SAML-Toolkits/ruby-saml/releases/tag/v1.18.0","tags":["x_refsource_MISC"]},{"url":"https://portswigger.net/research/saml-roulette-the-hacker-always-wins","tags":["x_refsource_MISC"]},{"url":"https://securitylab.github.com/advisories/GHSL-2024-329_GHSL-2024-330_ruby-saml","tags":["x_refsource_MISC"]},{"url":"https://security.netapp.com/advisory/ntap-20250314-0010/","tags":[]},{"url":"https://news.ycombinator.com/item?id=43374519","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2025/04/msg00011.html","tags":[]}],"priority":{"score":26.0,"factors":[{"name":"EPSS percentile","points":19.51},{"name":"CVSS severity","points":6.51}]},"vendorSlug":"saml-toolkits","affectedVersions":[{"vendor":"SAML-Toolkits","product":"ruby-saml","versions":["< 1.12.4",">= 1.13.0, < 1.18.0"]}],"affected":[{"ecosystem":"RubyGems","package":"ruby-saml","vulnerableRanges":["<1.12.4",">=1.13.0, <1.18.0"],"patched":["1.12.4","1.18.0"],"from":["GHSA-4vc4-m8qh-g8jm"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-6415","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-saml-toolkits-ruby-saml-cve-2024-45409","parents":[{"from":"CVE-2024-45409","to":"CVE-2025-25291","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:ruby-saml","fromFixed":"1.12.3","toFixed":"1.12.4","daysApart":183},{"kind":"same-code","provenance":"machine","files":["lib/xml_security.rb"],"commits":["https://github.com/SAML-Toolkits/ruby-saml/commit/1ec5392bc506fe43a02dbb66b68741051c5ffeae","https://github.com/SAML-Toolkits/ruby-saml/commit/4865d030cae9705ee5cdb12415c654c634093ae7","https://github.com/SAML-Toolkits/ruby-saml/commit/e76c5b36bac40aedbf1ba7ffaaf495be63328cd9","https://github.com/SAML-Toolkits/ruby-saml/commit/e9c1cdbd0f9afa467b585de279db0cbd0fb8ae97"],"basis":"shared function","functions":["validate_signature"]}]}],"children":[{"from":"CVE-2025-25291","to":"CVE-2025-25293","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/onelogin/ruby-saml/saml_message.rb"],"commits":["https://github.com/SAML-Toolkits/ruby-saml/commit/e76c5b36bac40aedbf1ba7ffaaf495be63328cd9","https://github.com/SAML-Toolkits/ruby-saml/commit/e9c1cdbd0f9afa467b585de279db0cbd0fb8ae97","https://github.com/SAML-Toolkits/ruby-saml/commit/acac9e9cc0b9a507882c614f25d41f8b47be349a","https://github.com/SAML-Toolkits/ruby-saml/commit/e2da4c6dae7dc01a4d9cd221395140a67e2b3eb1"],"basis":"shared function","functions":["decode_raw_saml"]}]},{"from":"CVE-2025-25291","to":"CVE-2025-66568","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/onelogin/ruby-saml/saml_message.rb"],"commits":["https://github.com/SAML-Toolkits/ruby-saml/commit/e76c5b36bac40aedbf1ba7ffaaf495be63328cd9","https://github.com/SAML-Toolkits/ruby-saml/commit/e9c1cdbd0f9afa467b585de279db0cbd0fb8ae97","https://github.com/SAML-Toolkits/ruby-saml/commit/acac9e9cc0b9a507882c614f25d41f8b47be349a"],"basis":"shared function","functions":["decode_raw_saml"]}]}],"packageHistory":[{"cve":"CVE-2016-5697","published":"2017-01-23","fixed":"1.3.0","kev":false},{"cve":"CVE-2017-11428","published":"2019-04-17","fixed":"1.7.0","kev":false},{"cve":"CVE-2024-45409","published":"2024-09-10","fixed":"1.17.0","kev":false},{"cve":"CVE-2025-25291","published":"2025-03-12","fixed":"1.18.0","kev":false},{"cve":"CVE-2025-25292","published":"2025-03-12","fixed":"1.18.0","kev":false},{"cve":"CVE-2025-25293","published":"2025-03-12","fixed":"1.18.0","kev":false},{"cve":"CVE-2025-66567","published":"2025-12-09","fixed":"1.18.0","kev":false}],"package":"RubyGems:ruby-saml"}}