← PHP / Laravel · 目录

PHP-098 / 中级

口令策略薄弱且未认识 bcrypt 72 字节限制

A07:2021 Identification and Authentication Failures · CWE-521 Weak Password Requirements

为什么存在问题?

允许短口令,bcrypt 忽略72字节之后的内容。

如何修复

php
$request->validate(['password' => ['required', 'confirmed', Password::min(12)->mixedCase()->numbers()->uncompromised(), 'max:72']]);

延伸阅读