Problem/Motivation
Whilst reviewing some contrib code it was noticed that hashes were not being compared or created correctly in several places in core.
In discussion on https://security.drupal.org/node/170071 we agreed this could be a public security hardening issue.
Proposed resolution
Use Crypt::hashEquals() to compare hashes
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 3057314-20.patch | 3.71 KB | alexpott |
| #15 | 3057314-15.patch | 3.7 KB | alexpott |
| #15 | 9-15-interdiff.txt | 4.32 KB | alexpott |
| #9 | 3057314-9.patch | 7.14 KB | alexpott |
| #9 | 7-9-interdiff.txt | 611 bytes | alexpott |
Comments
Comment #2
alexpottComment #5
alexpottCrediting @larowlan for code review on the private security issue.
Crediting @chr.fitsch for private discussions about this issue.
Comment #7
alexpottFix the tests.
Comment #8
larowlanshould we add an empty update hook to clear render caches?
Other than that, looks good to me
Comment #9
alexpott@larowlan sure lets do that.
Comment #10
larowlanLooks good to me
Comment #11
chr.fritschI am really in favor of this.
But I have one concern and I am not sure if this falls under the BC policy. In
processEntityAutocompletewe are changing the way how the $selection_settings_key is created.In the select2 module, I am calling
EntityAutocomplete::processEntityAutocomplete($element, new FormState(), $complete_form)and I have implemented my ownEntityAutocompleteController. That means the hashes will not match anymore there.So this change will break select2 and I am not able to make the select2 module 8.7 and 8.8 compatible without implementing my own
processEntityAutocompletemethod.Comment #12
chr.fritschOh, I just saw that this issue is targeted for 8.7, so it would break in a patch release.
Comment #13
berdir> So this change will break select2 and I am not able to make the select2 module 8.7 and 8.8 compatible without implementing my own processEntityAutocomplete method.
You could create both variants and accept either, but yes, I agree that this is a problem.
Comment #14
alexpottHmm.... how about we make this only about the hashEquals changes and then tackle adding the private key in in a different issue. That way we can concentrate on the BC implications.
Comment #15
alexpottDoing #14
Comment #16
alexpottI opened #3058396: Use private key in hash creation in EntityAutocomplete element for the correct salting.
Comment #17
chr.fritschThank you @alexpott for quickly changing that issue.
Comment #18
alexpottComment #19
larowlanDoesn't apply to 8.8.x anymore
Comment #20
alexpottgit handled the merge...
Bring on PRs
Comment #23
larowlanCommitted cf939a5 and pushed to 8.8.x. Thanks!
c/p to 8.7.x