-
Notifications
You must be signed in to change notification settings - Fork 52
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
User injection corrupt password #405
Comments
Hi @achillebnt This is the desired and functional behaviour GLPI is compatible with passwords in as soon as the user updates his password (which is recommended) GLPI will encrypt it with Best regards |
It's not a desired and functional behaviour... initially i do it only to update phone number of users and after i had to restore the database because no one can access to the portal. |
Ok I had misunderstood the context of the injection Can you past here your mapping ? |
Here the mapping I do my test and i think function processAfterInsertOrUpdate in inc/userinjection.class.php has to be reviewed because this part of code every time you save it take the value in database and rehash it. I comment out that query commit and my problem was gone. |
Can you apply this patch, enable GLPI debug mode diff --git a/inc/userinjection.class.php b/inc/userinjection.class.php
index 9447426..af2bd72 100644
--- a/inc/userinjection.class.php
+++ b/inc/userinjection.class.php
@@ -174,6 +174,7 @@ class PluginDatainjectionUserInjection extends User implements PluginDatainjecti
}
}
+ toolbox::logDebug($values['User']);
if (isset($values['User']['password']) && ($values['User']['password'] != '')) {
//We use an SQL request because updating the password is unesasy
//(self reset password process in $user->prepareInputForUpdate())
Then check you should see what this call gets |
Here the return log:
|
I create a simple model to import/update users, using username and phone as fields associated respectively to login and phone but when i do the import for some reason the password was changed to sha1 hash.
Doing a little debug i found this: writing a text password in database glpi_users.password for example pippo when i do the import that word will be converted to sha1 hash: d012f68144ed0f121d3cc330a17eec528c2e7d59
In the debug mode there is trace of sql query.
The text was updated successfully, but these errors were encountered: