{"record":{"id":"4b0283e57ecb1926","repo":"getgrav/grav","slug":"password-hashing-failed-internal-error","errorCode":null,"errorMessage":"Password hashing failed: internal error.","messagePattern":"Password hashing failed: internal error\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/User/Authentication.php","lineNumber":37,"sourceCode":"{\n    /**\n     * Create password hash from plaintext password.\n     *\n     * @param string $password Plaintext password.\n     *\n     * @throws RuntimeException\n     * @return string\n     */\n    public static function create($password): string\n    {\n        if (!$password) {\n            throw new RuntimeException('Password hashing failed: no password provided.');\n        }\n\n        $hash = password_hash($password, PASSWORD_DEFAULT);\n\n        if (!$hash) {\n            throw new RuntimeException('Password hashing failed: internal error.');\n        }\n\n        return $hash;\n    }\n\n    /**\n     * Verifies that a password matches a hash.\n     *\n     * @param string $password Plaintext password.\n     * @param string $hash     Hash to verify against.\n     *\n     * @return int              Returns 0 if the check fails, 1 if password matches, 2 if hash needs to be updated.\n     */\n    public static function verify($password, $hash): int\n    {\n        // Fail if hash doesn't match\n        if (!$password || !$hash || !password_verify($password, $hash)) {\n            return 0;","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/User/Authentication.php#L19-L55","documentation":"Error \"Password hashing failed: internal error.\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/User/Authentication.php:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}