Timing Attack Affecting github.com/xlzd/gotp package, versions <0.1.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMXLZDGOTP-2329719
  • published5 Jan 2022
  • disclosed5 Jan 2022
  • creditcodewinch

Introduced: 5 Jan 2022

CVE NOT AVAILABLE CWE-208  (opens in a new tab)

How to fix?

Upgrade github.com/xlzd/gotp to version 0.1.0 or higher.

Overview

github.com/xlzd/gotp is a Golang package for generating and verifying one-time passwords. It can be used to implement two-factor (2FA) or multi-factor (MFA) authentication methods in anywhere that requires users to log in.

Affected versions of this package are vulnerable to Timing Attack if the time that the user enabled OTP (one time password) can be guessed. This vulnerability exists due to the usage of weak RNG (random number generator) by rand.Seed(time.Now().UnixNano()) method in the RandomSecret function.

CVSS Base Scores

version 3.1