Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OWASP guidelines on max password length #67

Open
eliotsykes opened this issue Jul 24, 2020 · 1 comment
Open

OWASP guidelines on max password length #67

eliotsykes opened this issue Jul 24, 2020 · 1 comment

Comments

@eliotsykes
Copy link
Owner

Maximum Password Lengths

Some hashing algorithms such as Bcrypt have a maximum length for the input, which is 72 characters for most implementations (there are some reports that other implementations have lower maximum lengths, but none have been identified at the time of writing). Where Bcrypt is used, a maximum length of 64 characters should be enforced on the input, as this provides a sufficiently high limit, while still allowing for string termination issues and not revealing that the application uses Bcrypt.

Additionally, due to how computationally expensive modern hashing functions are, if a user can supply very long passwords then there is a potential denial of service vulnerability, such as the one published in Django in 2013.

In order to protect against both of these issues, a maximum password length should be enforced. This should be 64 characters for Bcrypt (due to limitations in the algorithm and implementations), and between 64 and 128 characters for other algorithms.

Source: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#maximum-password-lengths

@eliotsykes eliotsykes changed the title OWASP guidelines on max password length for bcrypt and other hashing algorithms OWASP guidelines on max password length for bcrypt and other hashing algorithms (mitigates DoS) Jul 24, 2020
@eliotsykes
Copy link
Owner Author

eliotsykes commented Jul 24, 2020

Django denial of service issue via large passwords: https://www.djangoproject.com/weblog/2013/sep/15/security/

@eliotsykes eliotsykes changed the title OWASP guidelines on max password length for bcrypt and other hashing algorithms (mitigates DoS) OWASP guidelines on max password length Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant