• Resolved Scott Kingsley Clark

    (@sc0ttkclark)


    First, some initial facts on my use-case:

    • WordPress 6.8
    • PHP 8.0.x (I know.. but I have work through a complex upgrade process for one of the plugins first)
    • I have a project that uses multisite for a www site (the primary) and a subdomain site (a site in the network)
    • Since WP 6.8, uses the new PHP hashing logic (bcrypt, but more importantly password_verify, password_hash, and password_needs_rehash)
    • Each site has their own login page
    • Logged into the main site for the first time and password was “upgraded”
    • Logged into the second site in the multisite network after that and now it says the password is invalid
    • Logging out and logging back into main site works
    • Upon deeper inspection, I am finding that the wp_password_needs_rehash() result is true on the second site meaning that the hashing does not match between sites
    • I have a custom COOKIE_DOMAIN set (to .domain.com so cookie can be access across subdomains) and a custom COOKIEHASH (so that the cookie can be shared across sites) — but I have disabled these in my testing to confirm they are no the cause of the issue

    Is it possible that the new WP 6.8 hashing logic that relies on built-in PHP hashing — is entirely hashed by the HTTP_HOST or some other unique identifier that I can’t quite see?

    I put together a quick plugin that I have in my mu-plugins directory to get around the issue: https://gist.github.com/sc0ttkclark/55abd765c7999d37fd984618040b2d1b

    It’s a terrible solution but it works for now and the result is you can only be logged into one site in the multisite network at a time 😭

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Scott Kingsley Clark

    (@sc0ttkclark)

    This turned out to be a weird issue with object cache.

    Main site updated the user_pass but the second site still saw the old user_pass so all of the cookie handling and login logic was failing.

    Danish Raza

    (@daniraz112)

    facing same issue

    Thanks for sharing the deep dive and temp workaround, Scott, really helpful! Hopefully the WP team addresses this multisite login quirk in an upcoming patch.

    Hello ! I have the same issue on my multisites. It’s quite anoying.

    Could you share your temporary fix again please ? I can’t see your github project from the link you shared. For now I retrograde to 6.7.2 version where it’s working.

    Thank, and I hope the WP team will correct this soon.

    Hello ! I have the same issue on my multisites. It’s quite anoying.

    Thread Starter Scott Kingsley Clark

    (@sc0ttkclark)

    I’ll repost my code again, I deleted it once I realized I had a separate object cache issue and didn’t think the code was helpful to people anymore. I stand corrected 🙂

    Will post the link shortly.

    Appreciate the deep dive and temp fix, Scott

    Thread Starter Scott Kingsley Clark

    (@sc0ttkclark)

    I can also confirm I’m experiencing the same issue on a multisite setup running WordPress 6.8.1, PHP 8.3, and Redis object caching.

    When I log in to the main site, the password is upgraded as expected. However, logging into a subsite with the same credentials fails with an “invalid password” error. Logging back into the main site still works…

    Disabling Redis and clearing all user-related object cache groups did not resolve the issue in my case. The only reliable workaround was reverting to WordPress 6.7.2 and re-setting the user password using an old-style md5 hash — everything then works normally across all subsites.

    This seems like a critical issue with how the new password hashing interacts with multisite and object caching. Hoping core addresses it soon.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.