Skip to:
Content

bbPress.org

Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#3683 closed defect (bug) (fixed)

phpBB: Support modern password hashes during first login

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Priority: normal Milestone: 2.6.18
Component: API - Importers Version: 2.6.17
Severity: normal Keywords: has-patch has-unit-tests
Cc:

Description

A current support report confirms that phpBB accounts are imported, but users cannot sign in with their existing passwords and must reset them:

​https://bbpress.org/forums/topic/importing-from-phpbb-to-bbpress-gets-stuck-in-a-loop-at-step-16/#post-249822

This is reproducible with current trunk.

Cause

phpBB::authenticate_pass() only recognizes phpBB 3.0's 34-character phpass hashes and unprefixed MD5 hashes. phpBB 3.1 and later use bcrypt, while newer phpBB versions can use Argon2i or Argon2id. Those hashes fall through to the MD5 comparison, so the first-login upgrade never updates wp_users.user_pass.

Representative bcrypt, Argon2i, and Argon2id hashes all fail the current converter even though PHP verifies them correctly.

Steps to reproduce

  1. Import a phpBB user whose user_password is a bcrypt or Argon2 hash.
  2. Confirm that the import stores the serialized hash in _bbp_password, records phpBB in _bbp_class, and clears the WordPress password as intended.
  3. Attempt to sign in with the user's valid phpBB password.

Expected

The converter verifies the phpBB hash, replaces the empty WordPress password with a WordPress hash, removes the temporary converter metadata, and allows the login.

Actual

The phpBB hash fails verification, the metadata remains, and authentication fails until the user resets the password.

A patch is prepared that delegates bcrypt and Argon2 verification to password_verify() while preserving the existing phpass and MD5 paths. It includes regression coverage for correct and incorrect bcrypt, Argon2i, and Argon2id passwords and malformed metadata.

Related: #1886.

Attachments (2)

3683.patch​ (1.3 KB ) - added by johnjamesjacoby 2 months ago.
Support bcrypt and Argon2 phpBB password upgrades on first login.
3683-tests.patch​ (3.7 KB ) - added by johnjamesjacoby 2 months ago.
Regression tests for phpBB phpass, MD5, bcrypt, Argon2i, Argon2id, and invalid metadata.

Download all attachments as: .zip

Change History (5)

@johnjamesjacoby
2 months ago

Support bcrypt and Argon2 phpBB password upgrades on first login.

@johnjamesjacoby
2 months ago

Regression tests for phpBB phpass, MD5, bcrypt, Argon2i, Argon2id, and invalid metadata.

#1 @johnjamesjacoby
2 months ago

  • Keywords has-patch has-unit-tests added

#2 @johnjamesjacoby
2 months ago

  • Owner set to johnjamesjacoby
  • Resolution → fixed
  • Status new → closed

In 7534:

API - Importers: support modern phpBB password hashes.

This change lets imported phpBB users upgrade bcrypt, Argon2, and combined phpass/bcrypt password hashes on first login. It also validates imported password metadata and adds regression coverage for supported hashes and the password-upgrade callback.

In branches/2.6, for 2.6.18.

Fixes #3683.

#3 @johnjamesjacoby
2 months ago

In 7535:

API - Importers: support modern phpBB password hashes.

This change lets imported phpBB users upgrade bcrypt, Argon2, and combined phpass/bcrypt password hashes on first login. It also validates imported password metadata and adds regression coverage for supported hashes and the password-upgrade callback.

In trunk, for 2.7.

See #3683.

Note: See TracTickets for help on using tickets.