网站上的数据泄露暴露了 Chrome 在我的登录表单上发送的密码消息

Bip*_*ane 19 php

我做了一个登录表单,一个经过身份验证的用户被重定向到他们的主页。但是,随着重定向 chrome 向我发送了这个这是chrome发送的消息

我对警告一无所知。我的代码是:

     /**
     * Go Login, login button is clicked
     * 
     * @return void
     */
    public function goLoginAction()
    {
        $user = new User($_POST);

        if ($user->verifyPassword()) {
            $user = User::findByUsername($user->username);

            Auth::login($user);

            $this->redirect("/$user->username/home/");
        } 

        $this->redirect('/');

    }
Run Code Online (Sandbox Code Playgroud)

go-login 是表单的操作。所以,$_POST 被发送到 go-login。verifyPassword 是验证密码的函数:

     /**
     * Verify password
     * 
     * @return true if password is correct, false otherwise
     */
    public function verifyPassword()
    {
        $users = static::findByUsername($this->username);
        if (password_verify($this->password, $users->password)) {
            return true;            
        }
        return false;
    }
Run Code Online (Sandbox Code Playgroud)

findByUsername 是按用户名返回对象用户的函数。并且,go-login 函数中的 Auth 类创建会话:

     /**
     * Login controller
     * Set session after login
     * 
     * @param object $user 
     * @return void
     */
    public static function login($user)
    {
        session_regenerate_id();

        $_SESSION['id'] = $user->id;
    }
Run Code Online (Sandbox Code Playgroud)

每个答案将不胜感激。请让我知道其他安全提示。谢谢!!

Bal*_*sök 6

我看到评论已经很好地消除了您的疑虑,但以防万一,这里有一个给新手的小结论。

翻译:博士

这是 Google Chrome 最近推出的一项功能。如果过去提供的用户名/电子邮件密码对的提交组合遭到破坏,Chrome 会尝试警告用户,也许他/她最好使用更强大的东西。它与代码无关,这意味着您要对用户的安全负责。

阅读有关此主题的外部链接。

  1. 这是在 Google Chrome 帮助社区上询问和回答的。
  2. 如果您对什么是强密码以及它如何与密码学相关联感兴趣,请考虑查看Wiki 页面,它写得很好。

  • 这是否意味着谷歌浏览器会将我所有页面的所有密码发送到服务器,在服务器上检查它是否是被破坏的密码之一,然后谁知道它会做什么? (4认同)