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

Improve default password policy #349

Closed
signebedi opened this issue Sep 9, 2024 · 1 comment
Closed

Improve default password policy #349

signebedi opened this issue Sep 9, 2024 · 1 comment

Comments

@signebedi
Copy link
Owner

signebedi commented Sep 9, 2024

The default password policy, reproduced below, limits the special characters that will be accepted:

PASSWORD_REGEX: str = os.getenv('PASSWORD_REGEX', r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+[\]{};\'\\:"|,.<>/?])[A-Za-z\d!@#$%^&*()_+[\]{};\'\\:"|,.<>/?]{8,}$')
PASSWORD_HELPER_TEXT: str = os.getenv('PASSWORD_HELPER_TEXT', "Password must be 8+ characters, must include at least one uppercase letter, at least one lowercase letter, at least one number, and at least one of the following symbols: ! @ $ % & * ?")

We should, I think, permit a wider range of special characters.

Additionally, the create_user and change_password jinja2 templates hardcode the password message and regex, despite these being available in the application config. There is probably an issue converting a regex from a raw python string to a javascript regex / string literal. We should address this as part of this issue, too, so that the front-end regex / message is the same as the backend.

@signebedi
Copy link
Owner Author

[bug] Forgot password confirmation does not test for regexes
The jinja2 templates for create_user and change_password assess passwords against a regex. But, the forgot_password_confirm template does not. This seems to have been an expediency, which we need to fix now.

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