PT-2026-25981 · Rubygems · Devise

Published

2026-03-17

·

Updated

2026-03-17

·

CVE-2026-32700

CVSS v4.0
6.0
VectorAV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

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.

Fix

Race Condition

Weakness Enumeration

Related Identifiers

CVE-2026-32700
GHSA-57HQ-95W6-V4FC

Affected Products

Devise