-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Bug]: passwordsalt migration missing #34780
Comments
It happened to me too after upgrading to Nextcloud 25 |
I just added the value to the config.php by using But still no change. |
try:
the passwordsalt needs to be not empty |
@CarlSchwan Ok, but setting a salt on an existing installation with users will not prevent users to login? Minutes ago I tried https://help.nextcloud.com/t/passwordsalt-missing-from-config-php/148081/2 and for sure this works as a workaround. |
Oddly the patch doesn't work on my instance... edit : it works. Cache problem. But I can't confirm actions like updating apps, the button is greyed out (maybe a browser problem) |
What patch did you apply?
|
I removed config check for passwordsalt as described here : https://help.nextcloud.com/t/passwordsalt-missing-from-config-php/148081/2 (not a bug in my browser as I thought) edit : it's a display bug, pressing enter works ! #34828 |
As far as I understand hashes, changing the salt would invalidate them. A procedure like this might work, but I know very little about the inner workings of nextcloud:
However, I don't know how to trigger such a password change. Furthermore, it could be that the hashes are also used for other things that are not user passwords, making migration more complicated. |
Sorry but I'm still confused what the outcome of all this is, As far as I know I've never had passwordsalt in my config file and my Nextcloud installation is as old as the first Nextcloud version releases in 2015-2016? It would be great that someone could point out what needs to be done.. for the moment I just removed the passwordsalt from:
But messing with the code it's not obviously a solution. Thanks, |
My understanding so far: NC v25.0.0 is checking for it and here the trouble started for old installations. My question already added to a previous post is "Will setting a salt on an existing installation with users prevent these users to login?" |
This Mind that just setting this parameter without a migration will render all your accounts inaccessible. IMHO the only option is to drop the enforcing of |
cc @juliushaertl @PVince81 @juliushaertl for opinions on that |
Let me clarify my statement:
|
Passwordsalt is used in lib/private/Security/Hasher.php only, and this includes a fallback if it was not set previously to try with an empty salt @rakekniven Did you actually try to setup a passwordsalt and then you couldn't login again? |
@CarlSchwan No, how to create such an salt? |
I gave it a try. Generated a password salt with base64 </dev/urandom | head -c 30 and inserted that into After that I upgraded to 25.0.1(from 24.0.6). Still logging in and changing passwords is possible. Meanwhile I'm pretty sure that
|
i have to add the "secret" parameter also, and everything works now |
I also tested it and adding the salt like #34780 (comment) seems to work. |
Yes it worked for me to @feanor12. Thanks. |
I had the passwordsalt but not the
If I put something into |
Maybe a typo. Try this and put the output in your printf "'secret' => '%s',\n" "$(base64 </dev/urandom | head -c 48)" Make sure there are no other lines starting with |
@wolegis Thank you for your hint.
I guess it is because my |
@knfoo I think you have no other option than to switch back to the empty Hopefully the Nextcloud developers come up with a migration path soon (not only for |
@wolegis I did that.
but still it says the value is missing 🤔 and my php skills is getting a little challenged to dig deeper. I tried with The log for this is:
|
Restart your server. Old code is still present in your OPcache. I quit here. This is not the place for personal support. |
Thank you for your input. I run Nextcloud in a container and build a new one to fix the Hopefully others can help me debug this issue. |
@knfoo just went through into the same issue and obviously need to edit the same file in |
@modzilla99 thank you! It has clearly been to long ago since I have installed Nextcloud, I totally forgot about that. It has just been working to well. Now it is working again for me 🙏 |
Also running nextcloud in a container and got hit by this. @knfoo did you succeed yet? |
@jejanim I did with these steps. Not sure if the first is needed but did it non the less.
|
Originally posted by @wolegis in #34780 (comment) This worked perfectly for me thanks! |
upgrading 24 -> 25 has been the first rough update for years. Somewhat sad that this issue here is four weeks old, and it is still present in NC25.0.1. In my case: i set a new, random passwordsalt to my existing config, and all old logins continued to work just fine. I just wish this was either automated or there was a warning somewhere along the way. |
ah, interesting, so this is from old versions or coming from ownCloud. I have an instance currently on NC 24 that was migrated two years ago from OC 10 and earlier, and indeed I don't have a password salt either. |
Because this increase the security as it allows new password to use it. Also this caused some application (e.g end to end encryption) to fail when
When hashing a password and in general using the
It is used already but only when setting new passwords. We don't rehash old passwords |
@CarlSchwan if The config entry has been officially deprecated in 2014 with 726626b |
Many thanks for taking care of this issue and answering my questions.
I had a closer look at New password hashes (anything that has Hashes of new passwords are generated by applying PHP's function Bottom line: For new passwords The only case when Please correct me if I'm wrong. |
@PVince81 Based on the administrator documentation and the comment in the
|
Bug description
Upgrading to 25 with a config.php that has no or an empty passwordsalt results in an error message.
There is no clear solution on how to introduce a passwordsalt setting to an older setup.
Adiddional description on discord: https://help.nextcloud.com/t/passwordsalt-missing-from-config-php/148081/2
Steps to reproduce
1.install 24
2.use a config.php without a passwordsalt
3.upgrade to 25
Expected behavior
A warning before the upgrade or migration/guide to use salted password hashes.
Possible questions:
Does setting passwordsalt make passwords unusable?
What must be done to migrate this setting?
Installation method
Community Docker image
Operating system
Other
PHP engine version
PHP 8.1
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 22.2.3 to 23.0.1)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: