CVE-2025-57821: Basecamp's Google Sign-In for Rails allowed redirects to a malformed URL
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 googlesignin 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.
Other sources
Basecamp's Google Sign-In adds Google sign-in to Rails applications. Prior to version 1.3.0, it is possible to craft a malformed URL that passes the "same origin" check, resulting in the user being redirected to another origin. 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. This issue has been patched in version 1.3.0. If upgrading is not possible at this time, a way to mitigate the chained attack can be done by explicitly setting SameSite=Lax or SameSite=Strict on the application session cookie.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-57821?
CVE-2025-57821 is considered a medium severity vulnerability due to its potential impact on user redirection.
How do I fix CVE-2025-57821?
To fix CVE-2025-57821, update Basecamp's Google Sign-In to version 1.3.0 or later.
What type of vulnerability is identified by CVE-2025-57821?
CVE-2025-57821 is a URL manipulation vulnerability that allows an attacker to bypass the same origin check.
Who is affected by CVE-2025-57821?
Rails applications using Basecamp's Google Sign-In prior to version 1.3.0 are affected by CVE-2025-57821.
What can happen if CVE-2025-57821 is exploited?
If exploited, CVE-2025-57821 may result in users being redirected to an unauthorized origin.