VYPR
Critical severityNVD Advisory· Published Mar 12, 2025· Updated Nov 3, 2025

ruby-saml vulnerable to SAML authentication bypass due to DOCTYPE handling (parser differential)

CVE-2025-25291

Description

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.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Authentication bypass in ruby-saml due to XML parser differential between ReXML and Nokogiri, enabling Signature Wrapping attacks; fixed in versions 1.12.4 and 1.18.0.

Vulnerability

Overview

CVE-2025-25291 is an authentication bypass vulnerability in the ruby-saml library, which implements SAML single sign-on (SSO) for Ruby. The root cause is a parser differential between the ReXML and Nokogiri XML parsers used by the library. These parsers can generate entirely different document structures from the same XML input, allowing an attacker to craft a SAML response that is interpreted differently during signature validation and subsequent processing [1][4]. This discrepancy enables a Signature Wrapping attack, where the attacker can bypass signature checks while injecting malicious content.

Exploitation

To exploit this vulnerability, an attacker must possess a single valid SAML signature created with the private key used by the target organization to sign SAML responses or assertions. With this signature, the attacker can construct a SAML assertion that passes signature validation on the service provider side but contains a different assertion structure due to the parser differential. The attack does not require prior authentication; it only requires possession of a valid signature, which could be obtained from a previously captured SAML response or through other means [3].

Impact

Successful exploitation leads to authentication bypass, allowing the attacker to log in as any user of the affected application. This effectively results in a full account takeover, as the attacker can impersonate any user without needing their credentials. The impact is critical, especially in enterprise environments where SAML SSO is used for access control [3].

Mitigation

The vulnerability is fixed in ruby-saml versions 1.12.4 and 1.18.0. Users of the library should upgrade immediately. Additionally, any dependent libraries (e.g., omniauth-saml) must be updated to versions that reference a fixed ruby-saml. The maintainers have released patches, and no workarounds are available [1][3].

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
ruby-samlRubyGems
< 1.12.41.12.4
ruby-samlRubyGems
>= 1.13.0, < 1.18.01.18.0

Affected products

4

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

16

News mentions

1