CVE-2025-54572: Ruby SAML DOS vulnerability with large SAML response
N/A
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
ruby-saml | rubygems | < 1.18.1 | 1.18.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability analysis began by examining the provided commit 38ef5dd1ce17514e202431f569c4f5633e6c2709
. The commit patch clearly shows a change in the order of operations within the decode_message
function in lib/ruby_saml/xml/decoder.rb
. Specifically, the call to base64_encoded?(message)
was moved to after the message size check (message.bytesize > max_bytesize
). The vulnerability description explains that the base64_encoded?
method performs a resource-intensive regular expression match. By performing this operation before validating the input size, an attacker could provide a very large input string, causing the application to hang while processing the regex, leading to a Denial of Service. The identified vulnerable function, RubySaml::XML::Decoder.decode_message
, is the exact location where this flawed logic existed. The patch directly addresses this by ensuring the size limit is enforced before any expensive processing occurs.
Vulnerable functions
RubySaml::XML::Decoder.decode_message
lib/ruby_saml/xml/decoder.rb