CVE-2025-54572
Ruby SAML DOS vulnerability with large SAML response
The Ruby SAML library is for implementing the client side of a SAML authorization. In versions 1.18.0 and below, a denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion. This is fixed in version 1.18.1.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
6.9
Ruby SAML DOS vulnerability with large SAML response
The Ruby SAML library is for implementing the client side of a SAML authorization. In versions 1.18.0 and below, a denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion. This is fixed in version 1.18.1.
- Record
CVE-2025-54572- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-770
- Updated
- 2026-11-02
EUVDEUVD-2025-23157
6.9
The Ruby SAML library is for implementing the client side of a SAML authorization. In versions 1.18.0 and below, a denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion. This is fixed in version 1.18.1.
- Record
EUVD-2025-23157- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-rrqh-93c8-j966
6.9
Ruby SAML DOS vulnerability with large SAML response
Summary
A denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion.
Details
ruby-saml includes a message_max_bytesize setting intended to prevent DOS attacks and decompression bombs. However, this protection is ineffective in some cases due to the order of operations in the code:
def decode_raw_saml(saml, settings = nil)
return saml unless base64_encoded?(saml) # <--- Issue here. Should be moved after next code block.
settings = OneLogin::RubySaml::Settings.new if settings.nil?
if saml.bytesize > settings.message_max_bytesize
raise ValidationError.new("Encoded SAML Message exceeds " + settings.message_max_bytesize.to_s + " bytes, so was rejected")
end
decoded = decode(saml)
...
end
The vulnerability is in the execution order. Prior to checking bytesize the base64_encoded? function performs regex matching on the entire input string:
!!string.gsub(/[\r\n]|\\r|\\n|\s/, "").match(BASE64_FORMAT)
Impact
What kind of vulnerability is it? Who is impacted?
When successfully exploited, this vulnerability can lead to:
- Excessive memory consumption
- High CPU utilization
- Application slowdown or unresponsiveness
- Complete application crash in severe cases
- Potential denial of service for legitimate users
All applications using ruby-saml with SAML configured and enabled are vulnerable.
Potential Solution
Reorder the validation steps to ensure max bytesize is checked first
def decode_raw_saml(saml, settings = nil)
settings = OneLogin::RubySaml::Settings.new if settings.nil?
if saml.bytesize > settings.message_max_bytesize
raise ValidationError.new("Encoded SAML Message exceeds " + settings.message_max_bytesize.to_s + " bytes, so was rejected")
end
return saml unless base64_encoded?(saml)
decoded = decode(saml)
...
end
- Record
GHSA-rrqh-93c8-j966- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-770
- Updated
- 2026-11-02
NVD
6.9
The Ruby SAML library is for implementing the client side of a SAML authorization. In versions 1.18.0 and below, a denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion. This is fixed in version 1.18.1.
- Record
CVE-2025-54572- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-400, CWE-770
- Updated
- 2026-11-02
OSV
6.9
Ruby SAML DOS vulnerability with large SAML response
The Ruby SAML library is for implementing the client side of a SAML authorization. In versions 1.18.0 and below, a denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion. This is fixed in version 1.18.1.
- Record
CVE-2025-54572- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-770
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2025-54572
6.9
The Ruby SAML library is for implementing the client side of a SAML authorization. In versions 1.18.0 and below, a denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion. This is fixed in version 1.18.1.
- Record
DEBIAN-CVE-2025-54572- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
OSVGHSA-rrqh-93c8-j966
6.9
Ruby SAML DOS vulnerability with large SAML response
Summary
A denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion.
Details
ruby-saml includes a message_max_bytesize setting intended to prevent DOS attacks and decompression bombs. However, this protection is ineffective in some cases due to the order of operations in the code:
def decode_raw_saml(saml, settings = nil)
return saml unless base64_encoded?(saml) # <--- Issue here. Should be moved after next code block.
settings = OneLogin::RubySaml::Settings.new if settings.nil?
if saml.bytesize > settings.message_max_bytesize
raise ValidationError.new("Encoded SAML Message exceeds " + settings.message_max_bytesize.to_s + " bytes, so was rejected")
end
decoded = decode(saml)
...
end
The vulnerability is in the execution order. Prior to checking bytesize the base64_encoded? function performs regex matching on the entire input string:
!!string.gsub(/[\r\n]|\\r|\\n|\s/, "").match(BASE64_FORMAT)
Impact
What kind of vulnerability is it? Who is impacted?
When successfully exploited, this vulnerability can lead to:
- Excessive memory consumption
- High CPU utilization
- Application slowdown or unresponsiveness
- Complete application crash in severe cases
- Potential denial of service for legitimate users
All applications using ruby-saml with SAML configured and enabled are vulnerable.
Potential Solution
Reorder the validation steps to ensure max bytesize is checked first
def decode_raw_saml(saml, settings = nil)
settings = OneLogin::RubySaml::Settings.new if settings.nil?
if saml.bytesize > settings.message_max_bytesize
raise ValidationError.new("Encoded SAML Message exceeds " + settings.message_max_bytesize.to_s + " bytes, so was rejected")
end
return saml unless base64_encoded?(saml)
decoded = decode(saml)
...
end
- Record
GHSA-rrqh-93c8-j966- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-400, CWE-770
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-54572
6.9
The Ruby SAML library is for implementing the client side of a SAML authorization. In versions 1.18.0 and below, a denial-of-service vulnerability exists in ruby-saml even with the message_max_bytesize setting configured. The vulnerability occurs because the SAML response is validated for Base64 format prior to checking the message size, leading to potential resource exhaustion. This is fixed in version 1.18.1.
- Record
UBUNTU-CVE-2025-54572- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
ruby-samlRubyGems |
before 1.18.1 | 1.18.1 |
ruby-samlDebian:12 |
All versions, plus listed versions 1.13.0-11.13.0-1+deb12u11.15.0-11.17.0-1 |
None known |
ruby-samlDebian:11 |
before 1.11.0-1+deb11u3, plus listed versions 1.11.0-11.11.0-1+deb11u11.11.0-1+deb11u2 |
1.11.0-1+deb11u3 |
ruby-samlRubyGems |
before 1.18.1, plus listed versions 0.0.50.0.60.0.70.0.80.2.1 Show 45 moreShow less0.2.20.2.30.3.00.3.10.3.20.3.30.3.40.4.00.4.10.4.20.4.30.4.40.4.50.4.60.4.70.5.00.5.10.5.20.5.30.6.00.7.00.7.10.7.20.7.30.8.00.8.10.8.100.8.110.8.120.8.130.8.140.8.150.8.160.8.170.8.180.8.20.8.30.8.40.8.50.8.60.8.70.8.80.8.90.90.9.1 |
1.18.1 |
ruby-samlUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 0.9.2-11.0.0-11.1.2-1ubuntu11.1.2-1ubuntu1+esm11.1.2-1ubuntu1+esm2 |
None known |
ruby-samlUbuntu:Pro:18.04:LTS |
All versions, plus listed versions 1.4.1-11.7.2-11.7.2-1ubuntu0.1~esm11.7.2-1ubuntu0.1~esm2 |
None known |
ruby-samlUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 1.7.2-11.11.0-11.11.0-1ubuntu0.11.11.0-1ubuntu0.1+esm1 |
None known |
ruby-samlUbuntu:Pro:22.04:LTS |
All versions, plus listed versions 1.11.0-11.13.0-11.13.0-1ubuntu0.11.13.0-1ubuntu0.1+esm1 |
None known |
ruby-samlUbuntu:Pro:24.04:LTS |
All versions, plus listed versions 1.15.0-11.15.0-1ubuntu0.24.04.11.15.0-1ubuntu0.24.04.1+esm1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-54572 is a medium vulnerability (CVSS 6.9) in Saml-toolkits Ruby-saml, published July 30, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.46%, the 39th percentile. Fixed in ruby-saml 1.18.1.
References
github.com/SAML-Toolkits/ruby-saml/security/advisories/GHSA-rrqh-93c8-j966
github.com/SAML-Toolkits/ruby-saml/pull/770
github.com/SAML-Toolkits/ruby-saml/commit/38ef5dd1ce17514e202431f569c4f5633e6c2709
github.com/SAML-Toolkits/ruby-saml/releases/tag/v1.18.1
lists.debian.org/debian-lts-announce/2025/09/msg00001.html
nvd.nist.gov/vuln/detail/CVE-2025-54572
Show 7 moreShow less
github.com/rubysec/ruby-advisory-db/blob/master/gems/ruby-saml/CVE-2025-54572.yml
github.com/advisories/GHSA-rrqh-93c8-j966
github.com/CVEProject/cvelistV5/tree/main/cves/2025/54xxx/CVE-2025-54572.json
security-tracker.debian.org/tracker/CVE-2025-54572
github.com/SAML-Toolkits/ruby-saml
ubuntu.com/security/CVE-2025-54572
cve.org/CVERecord?id=CVE-2025-54572
Left out here: 38 versions. The JSON record has them.