Security Fix: Replay and Denial of Service vulnerability in HOTP plugin

Impacted versions

  • Two-factor Authentication (TFA) 8.x-1.x versions prior to 8.x-1.6
  • Two-factor Authentication (TFA) 2.x versions prior to and including 2.0.0-alpha2

Description

If an incorrect token is entered on the token validation page for a HOTP token the counter would be reset to the equivalent of counter 0.

An incorrectly synchronized token can create a DoS by preventing login if all codes are previously used. A stored counter that does not match a remote token can create an apparent DoS if it is outside the allowed counter window compared to a token actual counter.

Mitigating factors

Since 8.x-1.3 TFA will check token hashes even if the site_hash has been changed.
An attack requires a valid username/password combination to exploit either vulnerability.

The 2.x development branch has been fixed since unrelated work was committed in Switch to spomky-labs/otphp

Impact on previous announced vulnerabilities

8.x-1.3 was announced that the HOTP plugin was not vulnerable however this exploit in combination with a deployment prior to 8.x-1.3 could allow exploitation of the previously announced replay attack with HOTP tokens

Drupal Security Advisory

This issue is published without a security advisory in accordance with the precedent set in preparing the 8.x-1.3 security fix release.

VCS Label
8.x-1.6
Core compatibility
Release type
Short description
Security Fix: Replay and Denial of Service vulnerability in HOTP plugin
Packaged Git sha1
426d5658c76995cb8474de6ee7fe7aaf236b7853
Release files
6593e07efa18dd8507faebdc1867129c
Release file SHA-1 hash
10e3c0d6c8741a7582f5a078b57686acdc1306e0
Release file SHA-256 hash
bb0166fa364d36f4a03ef76a7562f1472c95f5826b4515b28617400e3582f15b
0fe2f7b7647d813e50821a4d3b74e9fa
Release file SHA-1 hash
3b660e25b694fd97d7be777b07ab92b1fd7252f4
Release file SHA-256 hash
b28cbeb891f2861a2edef339a22032ad62085efc8818b59268145f0de2a3cce8