To avoid false positives weak algorithms should not be used (see https://www.drupal.org/node/845876)
Affected code:
docroot/modules/contrib/inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php 203
docroot/modules/contrib/inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php 586
docroot/modules/contrib/inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormSimple.php 35
docroot/modules/contrib/inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormSimple.php 155
Solution:
use Drupal’s hashBase64 methods:
\Drupal\Component\Utility\Crypt::hashBase64($data)
\Drupal\Component\Utility\Crypt::hmacBase64($data, $key)
in those files affected (see description)
Create a patch for the files mentioned in the description, share in d.o and use the patch from d.o url.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | inline_entity_form-usage_of_weak_algorithms-3069423-6.patch | 3.51 KB | omkar06 |
| #3 | inline_entity_form-usage_of_weak_algorithms-3069423-3.patch | 3.51 KB | omkar06 |
Comments
Comment #2
omkar06 commentedComment #3
omkar06 commentedComment #4
geek-merlinThanks for pointing this out and providing a patch. My gut feeling is the repeating code can go to a helper method.
+ // Since $parents can get quite long, encryption ensures that every id hasNit: ...hashing ensures...
Comment #5
geek-merlinNote: In #2653574-129: Unable to keep nested IEF data separate with multivalue fields. this seems to be factored out as
Comment #6
omkar06 commentedUpdating patch with correction mentioned in #4.
As in related issue, code is going to refactor, this patch also will need to revise as per new implementation. Meanwhile, if anyone required for current code, they can use this patch.
Comment #8
geek-merlinCommitted, thanks a bunch!