← PHP / Laravel · Contents

PHP-008 / Beginner

Storing passwords in plaintext or with fast hashes

A02:2021 Cryptographic Failures · CWE-256 / CWE-916

Why is this a problem?

After a leak, passwords can be recovered immediately or guessed in bulk using GPUs with hashes such as MD5 or SHA.

How to fix it

php
$user->password = Hash::make($request->password);  // bcrypt/argon2id

Further reading