GHSA-7PWC-WH6M-44Q3
Vulnerability from github – Published: 2025-08-27 16:46 – Updated: 2025-08-29 15:22Summary
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.
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "google_sign_in"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.3.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-57821"
],
"database_specific": {
"cwe_ids": [
"CWE-601"
],
"github_reviewed": true,
"github_reviewed_at": "2025-08-27T16:46:16Z",
"nvd_published_at": "2025-08-27T17:15:48Z",
"severity": "MODERATE"
},
"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\u0027s 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).",
"id": "GHSA-7pwc-wh6m-44q3",
"modified": "2025-08-29T15:22:58Z",
"published": "2025-08-27T16:46:16Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Google Sign-In for Rails allowed redirects to malformed URLs"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.