Timing Attack Affecting github.com/robbert229/jwt package, versions <1.0.0

  • Attack Complexity


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-id


  • published

    1 Oct 2017

  • disclosed

    31 Mar 2015

  • credit


How to fix?

Upgrade github.com/robbert229/jwt to version 1.0.0 or higher.


Affected versions of this package are vulnerable to Timing Attack. The library uses the insecure, non-constant string comparison function strings.Compare(), instead of the time constant string comparison. As a result, the comparison will fail faster when the first characters in the HMAC are incorrect. An attacker can use this difference to perform a timing attack, essentially allowing them to guess the HMAC one character at a time.

Similar vulnerability was previously found in Google's Keyczar crytographic library.