Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A data breach on a site exposed your password message sent by chrome on my login form

Tags:

php

I made a login form, an authenticated user is redirected to their home page. But, along with redirection chrome sent me this This is the message sent by chrome

I know nothing about the warning. My code is:

     /**
     * 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('/');

    }

go-login is the action of the form. So, $_POST is sent to go-login. verifyPassword is the function to verify password:

     /**
     * 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;
    }

findByUsername is the function to return the object user by username. And, Auth class in the go-login function creates the session:

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

        $_SESSION['id'] = $user->id;
    }

Every answer would be appreciated. And please let me know the other security tips as well. Thank you!!

like image 922
Biplove Lamichhane Avatar asked Dec 19 '19 13:12

Biplove Lamichhane


People also ask

What does it mean if Chrome found my password in a data breach?

When you type your credentials into a website, Chrome will now warn you if your username and password have been compromised in a data breach on some site or app. It will suggest that you change them everywhere they were used.

Is there a security breach with Google Chrome?

Google confirmed the attack, the third successful zero-day hack of its browser in 2022, in a new Chrome blog post. Google warned "that an exploit for CVE-2022-1364 exists in the wild" which means hackers were able to breach Chrome's security and begin attacking users before the company could issue a fix.

Does Google send messages about compromised passwords?

To help you secure your accounts, Google can help notify you if we find any of your saved passwords have been compromised.

What does it mean found in data breach?

A data breach is an incident where information is stolen or taken from a system without the knowledge or authorization of the system's owner. A small company or large organization may suffer a data breach.


1 Answers

I see the comments have cleared your doubts well, but just in case here is a small conclusion for newcomers.

TL:DR

This is a recently introduced feature to Google Chrome. If, in the past the submitted combination of the provided username/email-password pair was breached, Chrome will try to warn the user that maybe he/she would be better off using something more strong. It has nothing to do with code, which means that you are the one responsible for your users' security.

External links to read about this topic.

  1. This was asked and answered on Google Chrome Help community.
  2. If you are interested in what makes a strong password and how it is all connected to cryptography, consider checking out the Wiki page, it is pretty well written.
like image 109
Balázs Börcsök Avatar answered Oct 18 '22 15:10

Balázs Börcsök