CVE-2025-57821: Google sign in Google Sign-In For Rails Allowed Vulnerability

MODERATE
Advisory Identifier: GHSA-7pwc-wh6m-44q3
CVSS 4.2
CWE-601
Published
Advisory Summary

CVE-2025-57821 is a MODERATE (CVSS 4.2) google sign-in for rails allowed vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Google sign in libraries in the RubyGems ecosystem. The issue involves google sign-in for rails allowed redirects to malformed urls. Remediation is available by upgrading affected packages to version 1.3.0.

CVE-2025-57821 at a Glance

CVE Identifier CVE-2025-57821
GHSA Identifier GHSA-7pwc-wh6m-44q3
Severity MODERATE
CVSS v3.1 Base Score 4.2
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Google sign in
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 4.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-57821

To remediate this vulnerability, upgrade all affected Google sign in dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

google_sign_in fixed: 1.3.0
Upgrade google_sign_in to 1.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for google_sign_in

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-57821, inspect your project dependencies for Google sign in:

inspect dependencies for google_sign_in

Analyze the terminal output to locate any version of Google sign in in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Google sign in, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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. ### 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. ### 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](https://hackerone.com/muntrive?type=user).

CVE-2025-57821 Affected Google sign in Versions

1 component(s)
Fixed Versions:
1.3.0
Product / Package Ecosystem Affected Versions Fixed Version
google_sign_in
RubyGems
< 1.3.0
1.3.0

References

Frequently Asked Questions

What is CVE-2025-57821?
CVE-2025-57821 is a security vulnerability in Google sign in involving Google Sign-In for Rails allowed redirects to malformed URLs under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Google sign in versions are affected?
Affected versions include releases prior to 1.3.0 across affected packages: google_sign_in.
What version fixes CVE-2025-57821?
Upgrading to 1.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is google_sign_in affected?
Yes, google_sign_in is affected in releases prior to 1.3.0. Upgrade your dependency to 1.3.0 or later.
What is the CVSS score of CVE-2025-57821?
CVE-2025-57821 has a CVSS v3.1 base score of 4.2 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2025-57821?
CVE-2025-57821 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check RubyGems dependencies for CVE-2025-57821?
Run the dependency tree command: 'inspect dependencies for google_sign_in'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7pwc-wh6m-44q3",
  "modified" : "2025-08-29T15:22:58Z",
  "published" : "2025-08-27T16:46:16Z",
  "aliases" : [ "CVE-2025-57821" ],
  "summary" : "Google Sign-In for Rails allowed redirects to malformed URLs",
  "details" : "### Summary\n\nIt is possible to craft a malformed URL that passes the \"same origin\" check, resulting in the user being redirected to another origin.\n\n### Details\n\nThe 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.\n\nNormally 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.\n\n### Impact\n\nRails 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.\n\n### Workarounds\n\nIf 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.\n\n### Credits\n\nThis issue was responsibly reported by Hackerone user [muntrive](https://hackerone.com/muntrive?type=user).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "google_sign_in"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/google_sign_in/security/advisories/GHSA-7pwc-wh6m-44q3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-57821"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/google_sign_in/pull/73"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/google_sign_in/commit/85903651201257d4f14b97d4582e6d968ac32f15"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/google_sign_in/commit/a0548a604fb17e4eb1a57029f0d87e34e8499623"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/basecamp/google_sign_in"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/google_sign_in/releases/tag/v1.3.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/google_sign_in/CVE-2025-57821.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-27T16:46:16Z",
    "nvd_published_at" : "2025-08-27T17:15:48Z"
  }
}