Devise has a confirmable "change email" race condition that permits user to confirm email they have no access to
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A race condition in Devise's Confirmable module allows an attacker to confirm a victim's email address on their own account by sending concurrent email change requests.
CVE-2026-32700 is a race condition in the Devise authentication library's Confirmable module, specifically affecting the reconfirmable option used for email changes. The vulnerability allows an attacker to confirm an email address they do not control, enabling them to link a victim's email to their own account [2].
To exploit this, an attacker sends two concurrent HTTP requests to change the email on their account: one to an attacker-controlled address and another to the victim's address. Due to a race condition, the confirmation_token is sent to the attacker's email while the unconfirmed_email field in the database is set to the victim's address. The attacker can then use the token to confirm the victim's email on the attacker's account [3].
The impact is that the attacker gains the ability to associate a victim's email with their own account, potentially leading to account takeover or other security breaches if the email is used for password resets or notifications [2]. The vulnerability affects all Devise applications using the default reconfirmable setting with the Confirmable module.
Devise v5.0.3 patches this issue by ensuring that unconfirmed_email is forcefully persisted even when unchanged. Users should upgrade immediately. As a workaround, applications can override methods to force the attribute to be updated in the database, though Mongoid ORM may require additional steps [2][1].
AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
deviseRubyGems | < 5.0.3 | 5.0.3 |
Affected products
2- Range: <5.0.3
- heartcombo/devisev5Range: < 5.0.3
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
7- github.com/advisories/GHSA-57hq-95w6-v4fcghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-32700ghsaADVISORY
- github.com/heartcombo/devise/issues/5783ghsax_refsource_MISCWEB
- github.com/heartcombo/devise/pull/5784ghsax_refsource_MISCWEB
- github.com/heartcombo/devise/security/advisories/GHSA-57hq-95w6-v4fcghsax_refsource_CONFIRMWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/devise/CVE-2026-32700.ymlghsaWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/devise/GHSA-57hq-95w6-v4fc.ymlghsax_refsource_MISCWEB
News mentions
3- Japan’s PM orders cybersecurity review to stop Mythos going full CyberZillaThe Register Security · May 12, 2026
- ThreatsDay Bulletin: Edge Plaintext Passwords, ICS 0-Days, Patch-or-Die Alerts and 25+ New StoriesThe Hacker News · May 7, 2026
- Poisoned Ruby Gems and Go Modules Exploit CI Pipelines for Credential TheftThe Hacker News · May 1, 2026