Miggo Logo

CVE-2025-57821: Google Sign-In for Rails allowed redirects to malformed URLs

4.2

CVSS Score
3.1

Basic Information

EPSS Score
-
Published
8/27/2025
Updated
8/27/2025
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
google_sign_inrubygems< 1.3.01.3.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The analysis of the security advisory and the associated commit a0548a604fb17e4eb1a57029f0d87e34e8499623 clearly points to a single vulnerable function. The vulnerability, an open redirect (CWE-601), is caused by improper validation of the redirect URL within the ensure_same_origin method in lib/google_sign_in/redirect_protector.rb. The diff shows that the original implementation had a logical flaw: it would only raise a violation for blank URLs or for well-formed URLs that had a different origin. It did not account for malformed URLs that would fail the well-formed check (target =~ QUALIFIED_URL_PATTERN) and thus pass validation, leading to the vulnerability. The patch rectifies this by implementing a strict whitelist, only permitting URLs that are either valid and same-origin or are absolute paths. Any other format, including the malformed URLs that could be used for exploitation, will now raise a violation. The new test cases added in test/models/redirect_protector_test.rb explicitly check for this malformed URL scenario, confirming the nature of the fix. Therefore, the root cause is localized to the GoogleSignIn::RedirectProtector.ensure_same_origin function.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry It is possi*l* to *r**t * m*l*orm** URL t**t p*ss*s t** "s*m* ori*in" ****k, r*sultin* in t** us*r **in* r**ir**t** to *not**r ori*in. ### **t*ils T** *oo*l*_si*n_in **m p*rsists *n option*l URL *or r**ir**tion **t*r *ut**nti**tion. I*

Reasoning

T** *n*lysis o* t** s**urity **visory *n* t** *sso*i*t** *ommit `****************************************` *l**rly points to * sin*l* vuln*r**l* *un*tion. T** vuln*r**ility, *n op*n r**ir**t (*W*-***), is **us** *y improp*r v*li**tion o* t** r**ir**t