Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

#63573 closed defect (bug) (duplicate)

wp_signups.activation_key stored in cleartext – inconsistent with wp_users.user_activation_key

Reported by: misoksimin's profile misoksimin Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Currently, the activation_key stored in the wp_signups table is saved in cleartext, unlike the user_activation_key in the wp_users table, which is hashed using wp_hash_password().

This inconsistency introduces a security weakness, particularly in multisite setups. An attacker who gains read access to the database (e.g., via SQL injection or misconfigured permissions) could:

Read cleartext activation keys from wp_signups

Use them to fraudulently activate unconfirmed user accounts

This issue becomes more critical when:

The site is open for public registration (multisite with signups enabled)

The database is exposed through any plugin or access misconfiguration

💡 Proposed Change:
Update the signup activation logic to hash the activation_key before saving it in wp_signups, and modify the corresponding activation flow to use wp_check_password() when comparing the key.

This will:

Align with existing security practices used in wp_users

Mitigate the risk of account hijacking through leaked or accessed cleartext keys

Attachments (4)

wordpress Core.png (64.1 KB) - added by misoksimin 3 weeks ago.
wordpress Core 2.png (88.5 KB) - added by misoksimin 3 weeks ago.
activation_key_in_wp_users.png (33.7 KB) - added by yashjawale 3 weeks ago.
Activation key stored in wp_users table
activation_key_in_wp_signups.png (34.1 KB) - added by yashjawale 3 weeks ago.
Activation key stored in wp_signups table

Download all attachments as: .zip

Change History (6)

@yashjawale
3 weeks ago

Activation key stored in wp_users table

@yashjawale
3 weeks ago

Activation key stored in wp_signups table

#1 @yashjawale
3 weeks ago

Welcome to trac @misoksimin & thanks for submitting the ticket 🙌

I can confirm that activation_key in wp_signups is saved in cleartext format, contrary to them being stored as hashes in wp_users table. As visible in the attachments above.

I'll be happy to work on a patch that fixes this so when core committers see this issue a solution is already underway...

#2 @johnbillion
3 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the report @misoksimin.

This issue is already being worked on in #38474. If you'd like to review the approach there that would be a great help!

Note: See TracTickets for help on using tickets.