CVE-2025-25291ruby-saml parser differential enables signature wrapping
What broke
ruby-saml parsed the same SAML response with two XML stacks, ReXML and Nokogiri. They do not agree on which node is "the" signed assertion. An attacker who already has one valid signature (a normal SSO login) can wrap a new assertion around it. The verifier checks the signature on one tree and consumes attributes from the other. GitHub Security Lab's summary is the one to remember: "in possession of a single valid signature [the attacker] can construct SAML assertions themselves and log in as any user."
Patched in ruby-saml 1.12.4 and 1.18.0 (March 2025). GitLab and omniauth-saml were in the blast radius because they vendor or depend on the library.
Why it matters
This is not a one-off coding error. It is a parser differential, the same family as the 2024 ruby-saml bypass (CVE-2024-45409) and the incomplete fix that became CVE-2025-54572. SAML 2.0 is still how a large share of workforce SSO works. If your IdP or a SaaS SP is on an unpatched ruby-saml, every account is impersonable, including admins.
What to do
- Upgrade ruby-saml to 1.18.1 or later. 1.12.4 / 1.18.0 closed this pair but later bypasses (CVE-2025-66567, CVE-2025-66568) landed in December 2025.
- Rotate IdP signing keys after you patch. A leaked or captured valid signature is enough to build the wrap.
- Inventory every SP that uses omniauth-saml, GitLab SAML, or a homegrown ruby-saml integration. Library upgrades in the IdP do not save a SaaS app that still verifies assertions itself.
- Prefer a single XML stack. Dual parsers are a recurring SAML footgun.
Sources
- NVD: CVE-2025-25291
- GitHub Security Lab advisory on ruby-saml parser differentials
Related identity CVEs
Related on Start with Identity
- CVEruby-saml companion signature-wrapping bypass
The pair to CVE-2025-25291. A second signature-wrapping path in ruby-saml lets an attacker forge assertions and impersonate any user. The March 2025 patch was l
- CVEruby-saml denial of service via compressed SAML messages
A compressed SAML message can be inflated into a resource-exhaustion hit against ruby-saml. Not an impersonation bug, but it sits in the same March 2025 patch t
- CVEGitHub Enterprise Server SAML XML signature wrapping
A third 2024 GHES SAML path. An attacker with network access could wrap a signature and provision a privileged user. Same product, same year, same lesson: do no
- BlogFortinet's January SSO bypass hit boxes already patched for December's SAML bug
CVE-2026-24858 is the follow-on FortiCloud SSO SAML bypass. Devices patched for CVE-2025-59718 and 59719 were still exploitable. Actively exploited. CISA guidan
- GlossaryIdentity Federation
A trust relationship between identity providers and service providers that lets users authenticate once at their home IdP and access applications at the other p
- GlossaryService Provider (SP)
The application that consumes identity assertions from an IdP to grant the user access. In SAML it's the SP; in OIDC the equivalent is the Relying Party. The se
Technique
This CVE is an instance of Federation trust abuse and SAML forgery. A service provider that accepts a SAML assertion it should have rejected treats a forged identity as authenticated, because the failure sits in signature validation code, not in cryptography.