Skip to content

Legacy MD5 password check uses a loose comparison #474

Closed

Description

@caseysoftware

w2p_Authenticators_SQL::authenticate() (L24) upgrades old MD5 passwords with:

if (md5($password) == $result['user_password']) {

== between two numeric-looking strings compares them as numbers, so any stored hash of the form 0e followed by digits matches any password whose MD5 also has that form ("magic hashes"). This only affects accounts that still have an unconverted 32-character MD5 hash, but those are exactly the old, rarely used accounts.

Fix: hash_equals($result['user_password'], md5($password)). The SQL quoting in the same method is covered by #442.

Found by reading the code on dev-5.0.0 @ 179b4eaf; not yet reproduced on a running install.

Fix before Phase 0 of the REST API and MCP server proposal (#471).

Activity

  1. added
    api
    on Oct 23, 2026
  2. added a commit that references this issue on Oct 24, 2026
    18fe643
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiauthenticationsecurity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions