CVE-2024-38351

Pocketbase is an open source web backend written in go. In affected versions a malicious user may be able to compromise other user accounts. In order to be exploited users must have both OAuth2 and Password auth methods enabled. A possible attack scenario could be: 1. a malicious actor register with the targeted user's email (it is unverified), 2. at some later point in time the targeted user stumble on your app and decides to sign-up with OAuth2 (_this step could be also initiated by the attacker by sending an invite email to the targeted user_), 3. on successful OAuth2 auth we search for an existing PocketBase user matching with the OAuth2 user's email and associate them, 4. because we haven't changed the password of the existing PocketBase user during the linking, the malicious actor has access to the targeted user account and will be able to login with the initially created email/password. To prevent this for happening we now reset the password for this specific case if the previously created user wasn't verified (an exception to this is if the linking is explicit/manual, aka. when you send `Authorization:TOKEN` with the OAuth2 auth call). Additionally to warn existing users we now send an email alert in case the user has logged in with password but has at least one OAuth2 account linked. The flow will be further improved with ongoing refactoring and we will start sending emails for "unrecognized device" logins (OTP and MFA is already implemented and will be available with the next v0.23.0 release in the near future). For the time being users are advised to update to version 0.22.14. There are no known workarounds for this vulnerability.
Configurations

No configuration.

History

21 Nov 2024, 09:25

Type Values Removed Values Added
References () https://github.com/pocketbase/pocketbase/discussions/4355 - () https://github.com/pocketbase/pocketbase/discussions/4355 -
References () https://github.com/pocketbase/pocketbase/security/advisories/GHSA-m93w-4fxv-r35v - () https://github.com/pocketbase/pocketbase/security/advisories/GHSA-m93w-4fxv-r35v -

20 Jun 2024, 12:44

Type Values Removed Values Added
Summary
  • (es) Pocketbase es un backend web de código abierto escrito en go. En las versiones afectadas, un usuario malintencionado puede comprometer las cuentas de otros usuarios. Para ser explotados, los usuarios deben tener habilitados los métodos de autenticación OAuth2 y Contraseña. Un posible escenario de ataque podría ser: 1. un actor malintencionado se registra con el correo electrónico del usuario objetivo (no está verificado), 2. en algún momento posterior, el usuario objetivo tropieza con su aplicación y decide registrarse con OAuth2 (_este paso El atacante también podría iniciarlo enviando un correo electrónico de invitación al usuario objetivo_), 3. en una autenticación OAuth2 exitosa, buscamos un usuario de PocketBase existente que coincida con el correo electrónico del usuario OAuth2 y lo asociamos, 4. porque no hemos cambiado el contraseña del usuario de PocketBase existente durante la vinculación, el actor malicioso tiene acceso a la cuenta de usuario objetivo y podrá iniciar sesión con el correo electrónico/contraseña creado inicialmente. Para evitar que esto suceda, ahora restablecemos la contraseña para este caso específico si el usuario creado anteriormente no fue verificado (una excepción a esto es si el enlace es explícito/manual, también conocido como cuando envía `Autorización:TOKEN` con OAuth2 llamada de autenticación). Además, para advertir a los usuarios existentes, ahora enviamos una alerta por correo electrónico en caso de que el usuario haya iniciado sesión con contraseña pero tenga al menos una cuenta OAuth2 vinculada. El flujo se mejorará aún más con la refactorización continua y comenzaremos a enviar correos electrónicos para inicios de sesión de "dispositivos no reconocidos" (OTP y MFA ya están implementados y estarán disponibles con la próxima versión v0.23.0 en un futuro próximo). Por el momento, se recomienda a los usuarios que actualicen a la versión 0.22.14. No se conocen workarounds para esta vulnerabilidad.

18 Jun 2024, 17:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-06-18 17:15

Updated : 2024-11-21 09:25


NVD link : CVE-2024-38351

Mitre link : CVE-2024-38351

CVE.ORG link : CVE-2024-38351


JSON object : View

Products Affected

No product.

CWE
CWE-287

Improper Authentication