-
Notifications
You must be signed in to change notification settings - Fork 23
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
Ensure password slashing before validation #117
base: master
Are you sure you want to change the base?
Conversation
Updated the password-checking mechanism to include `wp_slash` for the input password to improve security. Additionally, added a mock implementation of `wp_slash` in `phpstan_bootstrap.php` for testing purposes.
Use `wp_slash` for password sanitization during user creation. Implement new tests to ensure registration and authentication work with passwords containing special characters. This ensures better security and functionality in handling complex passwords.
Use `wp_slash` for password sanitization during user creation. Implement new tests to ensure registration and authentication work with passwords containing special characters. This ensures better security and functionality in handling complex passwords.
Use `wp_slash` for password sanitization during user creation. Implement new tests to ensure registration and authentication work with passwords containing special characters. This ensures better security and functionality in handling complex passwords.
Thank you for contributing, @RenTheProgrammer. I will check this PR later this week. |
* @param string $value | ||
* @return string | ||
*/ | ||
public function sanitizePassword(string $value): string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the return type, as the plugin can also be used in older PHP versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the return types! Sorry about that!
Update WordPressData.php
Update WordPressDataInterface.php
Updated the password-checking mechanism to include
wp_slash
for the input password to improve security. Additionally, added a mock implementation ofwp_slash
inphpstan_bootstrap.php
for testing purposes.Issue Link
#116
Types of changes
Description
Added the function wp_slash to further protect passwords coming from json
https://developer.wordpress.org/reference/functions/wp_slash/
How has this been tested?
added nullable parameter to the TestBase->registerRandomUser to pass a password. If the parameter is not null it overrides the $password field. This prevents code duplication.
Added Two new Test Cases.
Authentication/Success
RegisterUsers
Screenshots (optional)
Checklist:
composer check-plugin
locally