To avoid false positives weak algorithms should not be used (see https://www.drupal.org/node/845876)

Affected code:

docroot/modules/contrib/captcha/src/Element/Captcha.php 117

Solution:

use Drupal’s hashBase64 methods:

\Drupal\Component\Utility\Crypt::hashBase64($data)
\Drupal\Component\Utility\Crypt::hmacBase64($data, $key)

Comments

omkar06 created an issue. See original summary.

omkar06’s picture

Assigned: omkar06 » Unassigned
Status: Active » Needs review
StatusFileSize
new1.35 KB
omkar06’s picture

Attaching revised patch.

nileshlohar’s picture

Updated patch.

heine’s picture

Would it not make more sense to directly use Crypt::randomBytesBase64() ?

nileshlohar’s picture

Thanks @Heine.
It makes sense.
Updating the patch.

omkar06’s picture

Status: Needs review » Reviewed & tested by the community

Patch provided on #6 tested on local and it looks working as expected.

wundo’s picture

Priority: Normal » Major
wundo’s picture

  • wundo committed 6731656 on 8.x-1.x authored by nileshlohar
    Issue #3103145 by omkar06, nileshlohar, wundo, Heine: Weak algorithms...
wundo’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.