CVE-2025-57821

CVE-2025-57821 is a medium-severity open redirect vulnerability in google_sign_in (rubygems), affecting versions < 1.3.0. It is fixed in 1.3.0.

Summary

It is possible to craft a malformed URL that passes the "same origin" check, resulting in the user being redirected to another origin.

Details

The google_sign_in gem persists an optional URL for redirection after authentication. If this URL is malformed, it's possible for the user to be redirected to another origin after authentication, possibly resulting in exposure of authentication information such as the token.

Normally the value of this URL is only written and read by the library. If applications are configured to store session information in a database, there is no known vector to exploit this vulnerability. However, applications may be configured to store this information in a session cookie, in which case it may be chained with a session cookie attack to inject a crafted URL.

Workarounds

If you are unable to upgrade this library, then you may mitigate the chained attack by explicitly setting SameSite=Lax or SameSite=Strict on the application session cookie.

Credits

This issue was responsibly reported by Hackerone user muntrive.

Impact

Rails applications configured to store the flash information in a session cookie may be vulnerable, if this can be chained with an attack that allows injection of arbitrary data into the session cookie.

Untrusted input controls a URL used for redirection, which can forward users to attacker-controlled sites. Typical impact: phishing and credential harvesting via a trusted domain.

CVE-2025-57821 has a CVSS score of 4.2 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.3.0); upgrading removes the vulnerable code path.

Affected versions

google_sign_in (< 1.3.0)

Security releases

google_sign_in → 1.3.0 (rubygems)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade google_sign_in to 1.3.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2025-57821? CVE-2025-57821 is a medium-severity open redirect vulnerability in google_sign_in (rubygems), affecting versions < 1.3.0. It is fixed in 1.3.0. Untrusted input controls a URL used for redirection, which can forward users to attacker-controlled sites.
  2. How severe is CVE-2025-57821? CVE-2025-57821 has a CVSS score of 4.2 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of google_sign_in are affected by CVE-2025-57821? google_sign_in (rubygems) versions < 1.3.0 is affected.
  4. Is there a fix for CVE-2025-57821? Yes. CVE-2025-57821 is fixed in 1.3.0. Upgrade to this version or later.
  5. Is CVE-2025-57821 exploitable, and should I be worried? Whether CVE-2025-57821 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2025-57821 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2025-57821? Upgrade google_sign_in to 1.3.0 or later.

Other vulnerabilities in google_sign_in

CVE-2025-58067

Stop the waste.
Protect your environment with Kodem.