# CVE-2025-25291: ruby-saml vulnerable to SAML authentication bypass due to DOCTYPE handling (parser differential)

> An attacker can bypass SAML authentication in ruby-saml by exploiting parser differences to execute a Signature Wrapping attack.

- **Severity:** Critical 9.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Mar 2025
- **Updated:** 3 Nov 2025
- **Also known as:** BIT-gitlab-2025-25291, DEBIAN-CVE-2025-25291, GHSA-4vc4-m8qh-g8jm, UBUNTU-CVE-2025-25291

## What is CVE-2025-25291?

CVE-2025-25291 is a critical authentication bypass vulnerability in Netapp Storagegrid, published on 12 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-436 (Interpretation Conflict), CWE-347 (Improper Verification of Cryptographic Signature)

## Which versions are affected by CVE-2025-25291?

5 open source packages ship an affected version, including ruby-saml and gitlab. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ruby-saml` | RubyGems | All versions | 1.12.4 |
| `ruby-saml` | RubyGems | All versions | 1.12.4 |
| `ruby-saml` | RubyGems | From 1.13.0 | 1.18.0 |
| `ruby-saml` | RubyGems | From 1.13.0 | 1.18.0 |
| `gitlab` | Bitnami | All versions | 17.9.2 |

Products: Netapp Storagegrid, Omniauth Omniauth Saml, Onelogin Ruby-Saml.

## How do I fix CVE-2025-25291?

Upgrade ruby-saml to a fixed version for your release line: 1.12.4 or 1.18.0.

## Is CVE-2025-25291 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-25291 exists.

## Other vulnerabilities in Netapp Storagegrid

- [CVE-2025-25292](https://insights.sbomify.com/CVE-2025-25292/): Ruby SAML vulnerable to SAML authentication bypass due to namespace handling (parser differential) (critical 9.3)
- [CVE-2025-26515](https://insights.sbomify.com/CVE-2025-26515/): CVE-2025-26515 Server-Side Request Forgery Vulnerability in StorageGRID (formerly StorageGRID Webscale) (high 7.5)
- [CVE-2022-38734](https://insights.sbomify.com/CVE-2022-38734/): Denial of service in Denial of Service Vulnerability in StorageGRID (formerly StorageGRID Webscale) (high 7.5)
- [CVE-2022-23233](https://insights.sbomify.com/CVE-2022-23233/): Denial of service in StorageGRID (formerly StorageGRID Webscale) (high 7.5)
- [CVE-2020-8571](https://insights.sbomify.com/CVE-2020-8571/): Denial of service in StorageGRID (formerly StorageGRID Webscale) (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-25291 and fix it if it is affected.

What it is: CVE-2025-25291 is a critical authentication bypass vulnerability in Netapp Storagegrid, published on 12 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-25291 exists.

Affected packages and fixed versions:
- ruby-saml (RubyGems): affected all versions; fixed in 1.12.4
- ruby-saml (RubyGems): affected all versions; fixed in 1.12.4
- ruby-saml (RubyGems): affected from 1.13.0; fixed in 1.18.0
- ruby-saml (RubyGems): affected from 1.13.0; fixed in 1.18.0
- gitlab (Bitnami): affected all versions; fixed in 17.9.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-25291/ (Markdown: https://insights.sbomify.com/CVE-2025-25291/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-25291
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-25291
- OSV: https://osv.dev/vulnerability/CVE-2025-25291

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-25291/
Summaries are generated and may contain mistakes; the official description above is the record.
