[16.0][FIX] users_ldap_groups: safe LDAP decode - #596
Conversation
|
This same bug affects all other versions, too. I'm about to give up writing the test coverage for this change because codecov keeps complaining about everything I try. (Especially I didn't understand why it demands test coverage for the tests, too.) My idea is to add binary data to the LDAP response, e.g., a minimal GIF image as the LDAP attribute |
|
Tested with Odoo 16.0.20240102 on Ubuntu 22.04. |
rvalyi
left a comment
There was a problem hiding this comment.
I'm no ldap specialist at all, but I understand the vulnerability and your fix seems both reasonable and safe so I approve it. Let's give it a couple more days to see if we get another reviewer. If not I will be able to merge it.
But yeah the ldap module isn't very actively maintained and possibly the maintainers just missed your issue. You could eventually propose yourself as a module maintainer (adding your GitHub user to the maintainers value of the module manifest file in a PR will be enough to enable to let you merge and publish improvements in the module).
Thank you for the fix.
sbidoul
left a comment
There was a problem hiding this comment.
Thanks for submitting this fix.
For next time, note security@odoo-community.org may be contacted for reporting such issues.
|
This decode-that-encodes-in-base64 looks a bit weird to me. Why is the Perhaps, to move faster, you could do the security fix in a PR, so I can merge this, and do the decode improvement in another PR and work on that one with folks who are more familiar with this module? |
This simply replaces the original So, why not use this Does this satisfactorily explain the situation here? |
|
Rebased to fix the checks that didn't pass; the problem was in another module. Could someone please review & merge this already? |
The group mapping in query mode fails if LDAP returns binary data in any of the fields. This adds a function that handles such situation by base64 encoding it. The new test test_users_ldap_groups_ldap_returns_binary_data covers the common case where LDAP return binary data in thumbnailPhoto.
|
Rebased over |
|
@sbidoul It seems difficult to get anyone that actually knows something about LDAP to review this fix. However, this has been running on an instance for months and has fixed a real-life problem there. The problematic LDAP response has been demonstrated in a new test this PR adds, and all the previous tests are passing, too. Could this finally be merged? |
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at d4fee8b. Thanks a lot for contributing to OCA. ❤️ |
The group mapping in query mode fails if LDAP returns binary data in any of the fields. This adds a function that handles such situation by base64 encoding it.