[7.0]Auth crypt encrypts passwords lazily and deactivated users will never have password encrypted

Bug #1280152 reported by Nicolas Bessi - Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP's Framework R&D

Bug Description

Auth_crypt module use by default md5 hash instead of the proposed sha256.

Sadly this implementation is broken.

Also passwords are only encrypted when user log in for the first time.
So deactivated usesr will never have their password encrypted.

Regards

Nicolas

Related branches

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hi Nicolas,

As we discussed on Twitter, this bug report contains 2 different issues:
 1) auth_crypt in 7.0 encrypts user passwords lazily, instead of immediately forcing the encryption at install
 2) auth_crypt only supports the deprecated md5_crypt algorithm, while more secure options are recommended (the code contains a partial attempt to introduce a sha256 algorithm but it was never completed)

Let's focus on issue 1) in this bug report, and address 2) in another (wishlist) improvement request for trunk.

Regarding the latter, instead of trying to fix the current sha256 method I suggest to remove all algorithms from auth_crypt and depend on the passlib implementation (it's now officially included in Debian 7.0, so we could add this dependency in v8). Passlib supports our current md5_crypt passwords, so it would be easy to integrate it, and switch to a modern default for new passwords (sha256 or 512 for example). We can further discuss it on another bug report if you would like to work on it.

Thanks,

summary: - [7.0][trunk]Auth crypt sha256 is broken and deactivated users will never
- have password encrypted
+ [7.0]Auth crypt encrypts passwords lazily and deactivated users will
+ never have password encrypted
Changed in openobject-addons:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
milestone: none → 7.0
status: New → Confirmed
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

I have made the modification as discussed

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Fixed in 7.0 in github at revision https://github.com/odoo-dev/odoo/commit/f29ff5ef
Thanks for reporting and proposing a patch!

Changed in openobject-addons:
status: Confirmed → Fix Released
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Concerning 2) in comment #1, the upgrade to passlib and a hash algorithm has been implemented and should be included in v8:
  https://github.com/odoo/odoo/pull/640

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.