CVE-2025-57821
JSON

4.2medium

Basecamp's Google Sign-In for Rails allowed redirects to a malformed URL

Severity
4.2medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.29% (higher than 22% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-7pwc-wh6m-44q3

Description

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.

Affected

Product or packageVersionsReported by
basecamp google_sign_in< 1.3.0CVE List
google_sign_in (RubyGems)before 1.3.0GitHub Advisory Database

All scores

GitHub_M4.2medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
GitHub4.2medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N

Classification

CWE-601

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
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.

NVD (es)

El inicio de sesión de Google de Basecamp incorpora el inicio de sesión de Google a las aplicaciones Rails. Antes de la versión 1.3.0, era posible manipular una URL mal formada que superara la comprobación de "mismo origen", lo que provocaba que el usuario fuera redirigido a otro origen. Las aplicaciones Rails configuradas para almacenar la información flash en una cookie de sesión pueden ser vulnerables si esto se combina con un ataque que permita la inyección de datos arbitrarios en la cookie de sesión. Este problema se ha corregido en la versión 1.3.0. Si la actualización no es posible en este momento, se puede mitigar el ataque encadenado configurando explícitamente SameSite=Lax o SameSite=Strict en la cookie de sesión de la aplicación.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-57821 changed 2025-08-27CVE Terms of Use
GitHub Advisory DatabaseGHSA-7pwc-wh6m-44q3 changed 2025-08-29CC-BY-4.0
NVDCVE-2025-57821 changed 2026-06-17Public domain