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

Can't login with certain characters as Password #236

Open
yogasukma opened this issue Jun 18, 2023 · 2 comments
Open

Can't login with certain characters as Password #236

yogasukma opened this issue Jun 18, 2023 · 2 comments

Comments

@yogasukma
Copy link

yogasukma commented Jun 18, 2023

I found issue with core install and user update, both command give different result when using same password.

So, the password is aTeeest'AM@1$987

Then i install WordPress using command

wp core install --admin_password='aTeeest'\''AM@1$987' --url=password22.test --title="password22" --admin_user="password22"  --admin_email="[email protected]" 

You see i am trying to escape single quote and dollar sign characters in --admin_password parameters.

While the command is run fine, i can't login using my password above.

Interestingly, when i did same with user update, like this

wp user update 1 --user_pass='aTeeest'\''AM@1$987'

Notice that --user_pass is same value with --admin_password, and It going fine, i can login with password i mentioned above.

Question is why it behave differently? is it bug? am i escape that special characters wrongly?

Thank You.

@yogasukma
Copy link
Author

yogasukma commented Jun 18, 2023

Another example:

my password is 1'2"34$56 and escaped version is 1'2\"34\$56

echo "1'2\"34\$56"
// will return 1'2"34$56

I can't login if I installed WordPress with this command

wp core install --admin_password="1'2\"34\$56" --url=password22.test --title="password22" --admin_user="password22"  --admin_email="[email protected]" 

but when i update user using this command

wp user update 1 --user_pass="1'2\"34\$56"

it will be fine, i can login with my password above.

@danielbachhuber
Copy link
Member

@yogasukma I added some debug to both commands. It seems like the arguments are parsed correctly in both scenarios:

$ wp user update 1 --user_pass='aTeeest'\''AM@1$987'
array(1) {
  ["user_pass"]=>
  string(16) "aTeeest'AM@1$987"
}
$ wp core install --admin_password='aTeeest'\''AM@1$987' --url=password22.test --title="password22" --admin_user="password22"  --admin_email="[email protected]"
array(5) {
  ["url"]=>
  string(12) "vanilla.test"
  ["title"]=>
  string(10) "password22"
  ["admin_user"]=>
  string(10) "password22"
  ["admin_password"]=>
  string(16) "aTeeest'AM@1$987"
  ["admin_email"]=>
  string(20) "[email protected]"
}

Does the problem manifest with other sites too? Does it reproduce with a fresh WordPress install and no plugins active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants