The module is using the following code.
function honeypot_get_signed_timestamp($time) {
$private_key = Drupal::service('private_key')->get();
return $time . '|' . Crypt::hashBase64($time, $private_key);
}
Crypt::hashBase64() accepts just an argument: the data for which you need the hash. What requires two arguments is Crypt::hmacBase64().
The result is that the module is giving out in clear the hash of the timestamp together the timestamp. If spammers understand this, it would easier for them to forge a value.
The code should use Crypt::hmacBase64().
Comments
Comment #2
geerlingguy commented@kiamlaluno - You're correct! Thanks for the catch. I'll fix this soon...
Comment #3
geerlingguy commentedLet the testbot do it's thing.
Comment #4
dmitryVL commentedLooks good for me, easy way for spam protection. Move to rtbc.
Comment #6
geerlingguy commentedIt's fine in Drupal 7... must've just been a brain fart when I was porting the change to Drupal 8.