Miggo Logo

CVE-2025-54572: Ruby SAML DOS vulnerability with large SAML response

N/A

CVSS Score

Basic Information

EPSS Score
-
Published
7/30/2025
Updated
7/30/2025
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
ruby-samlrubygems< 1.18.11.18.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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
The vulnerability exists because the `decode_message` function calls `base64_encoded?` before checking the size of the input message. The `base64_encoded?` function uses a regular expression to validate the input. When a very large, non-Base64 encoded string is passed as the `message`, the regex matching consumes excessive CPU and memory, leading to a denial-of-service condition. The patch mitigates this by moving the size check before the call to `base64_encoded?`.

WAF Protection Rules

WAF Rule

### Summ*ry * **ni*l-o*-s*rvi** vuln*r**ility *xists in ru*y-s*ml *v*n wit* t** m*ss***_m*x_*yt*siz* s*ttin* *on*i*ur**. T** vuln*r**ility o**urs ****us* t** S*ML r*spons* is v*li**t** *or **s*** *orm*t prior to ****kin* t** m*ss*** siz*, l***in* to

Reasoning

T** vuln*r**ility *n*lysis ****n *y *x*minin* t** provi*** *ommit `****************************************`. T** *ommit p*t** *l**rly s*ows * ***n** in t** or**r o* op*r*tions wit*in t** `***o**_m*ss***` *un*tion in `li*/ru*y_s*ml/xml/***o**r.r*`. S