CVE-2026-32700
JSON

6.0medium

Devise has a confirmable "change email" race condition that permits user to confirm email they have no access to

Severity
6.0medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.30% (higher than 25% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-57hq-95w6-v4fc

Description

Devise is an authentication solution for Rails based on Warden. Prior to version 5.0.3, a race condition in Devise's Confirmable module allows an attacker to confirm an email address they do not own. This affects any Devise application using the `reconfirmable` option (the default when using Confirmable with email changes). By sending two concurrent email change requests, an attacker can desynchronize the `confirmation_token` and `unconfirmed_email` fields. The confirmation token is sent to an email the attacker controls, but the `unconfirmed_email` in the database points to a victim's email address. When the attacker uses the token, the victim's email is confirmed on the attacker's account. This is patched in Devise v5.0.3. Users should upgrade as soon as possible. As a workaround, applications can override a specific method from Devise models to force `unconfirmed_email` to be persisted when unchanged. Note that Mongoid does not seem to respect that `will_change!` should force the attribute to be persisted, even if it did not really change, so the user might have to implement a workaround similar to Devise by setting `changed_attributes["unconfirmed_email"] = nil` as well.

Affected

Product or packageVersionsReported by
heartcombo devise< 5.0.3, before 5.0.3CVE List, NVD
devise (RubyGems)before 5.0.3GitHub Advisory Database

All scores

GitHub_M6.0medium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-362

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

What each source says

CVE List

Devise is an authentication solution for Rails based on Warden. Prior to version 5.0.3, a race condition in Devise's Confirmable module allows an attacker to confirm an email address they do not own. This affects any Devise application using the `reconfirmable` option (the default when using Confirmable with email changes). By sending two concurrent email change requests, an attacker can desynchronize the `confirmation_token` and `unconfirmed_email` fields. The confirmation token is sent to an email the attacker controls, but the `unconfirmed_email` in the database points to a victim's email address. When the attacker uses the token, the victim's email is confirmed on the attacker's account. This is patched in Devise v5.0.3. Users should upgrade as soon as possible. As a workaround, applications can override a specific method from Devise models to force `unconfirmed_email` to be persisted when unchanged. Note that Mongoid does not seem to respect that `will_change!` should force the attribute to be persisted, even if it did not really change, so the user might have to implement a workaround similar to Devise by setting `changed_attributes["unconfirmed_email"] = nil` as well.

GitHub Advisory Database
Impact

A race condition in Devise's Confirmable module allows an attacker to confirm an email address they do not own. This affects any Devise application using the reconfirmable option (the default when using Confirmable with email changes).

By sending two concurrent email change requests, an attacker can desynchronize the confirmation_token and unconfirmed_email fields. The confirmation token is sent to an email the attacker controls, but the unconfirmed_email in the database points to a victim's email address. When the attacker uses the token, the victim's email is confirmed on the attacker's account.

Patches

This is patched in Devise v5.0.3. Users should upgrade as soon as possible.

Workarounds

Applications can override this specific method from Devise models to force unconfirmed_email to be persisted when unchanged: (assuming your model is User)

class User < ApplicationRecord
  protected

  def postpone_email_change_until_confirmation_and_regenerate_confirmation_token
    unconfirmed_email_will_change!
    super
  end
end

Note: Mongoid does not seem to respect that will_change! should force the attribute to be persisted, even if it did not really change, so you might have to implement a workaround similar to Devise by setting changed_attributes["unconfirmed_email"] = nil as well.

NVD (es)

Devise es una solución de autenticación para Rails basada en Warden. Antes de la versión 5.0.3, una condición de carrera en el módulo Confirmable de Devise permite a un atacante confirmar una dirección de correo electrónico que no posee. Esto afecta a cualquier aplicación Devise que utilice la opción 'reconfirmable' (la predeterminada al usar Confirmable con cambios de correo electrónico). Al enviar dos solicitudes concurrentes de cambio de correo electrónico, un atacante puede desincronizar los campos `confirmation_token` y `unconfirmed_email`. El token de confirmación se envía a un correo electrónico que el atacante controla, pero el `unconfirmed_email` en la base de datos apunta a la dirección de correo electrónico de una víctima. Cuando el atacante utiliza el token, el correo electrónico de la víctima se confirma en la cuenta del atacante. Esto está parcheado en Devise v5.0.3. Los usuarios deben actualizar lo antes posible. Como solución alternativa, las aplicaciones pueden sobrescribir un método específico de los modelos de Devise para forzar que `unconfirmed_email` se persista cuando no ha cambiado. Tenga en cuenta que Mongoid no parece respetar que `will_change!` debería forzar que el atributo se persista, incluso si realmente no cambió, por lo que el usuario podría tener que implementar una solución alternativa similar a Devise estableciendo `changed_attributes["unconfirmed_email"] = nil` también.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-32700 changed 2026-03-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-57hq-95w6-v4fc changed 2026-03-30CC-BY-4.0
NVDCVE-2026-32700 changed 2026-06-17Public domain