Make WordPress Core

#63573 closed defect (bug) (duplicate)

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

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

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 16 months ago.
wordpress Core 2.png​ (88.5 KB ) - added by misoksimin 16 months ago.
activation_key_in_wp_users.png​ (33.7 KB ) - added by yashjawale 16 months ago.
Activation key stored in wp_users table
activation_key_in_wp_signups.png​ (34.1 KB ) - added by yashjawale 16 months ago.
Activation key stored in wp_signups table

Download all attachments as: .zip

Change History (6)

@yashjawale
16 months ago

Activation key stored in wp_users table

@yashjawale
16 months ago

Activation key stored in wp_signups table

#1 @yashjawale
16 months 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
16 months ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → 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.