Timing Attack Affecting fernet package, versions <0.1.0 >=0.0.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

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 npm:fernet:20140306
  • published 22 Nov 2016
  • disclosed 6 Mar 2014
  • credit Chris Continanza

Introduced: 6 Mar 2014

CVE NOT AVAILABLE CWE-208 Open this link in a new tab

How to fix?

Upgrade fernet to version 0.1.0 or higher.

Overview

fernet is a Javascript implementation of Fernet symmetric encryption. Affected versions of the package are vulnerable to a timing attack.

The library implemented a character to character comparison, similar to the built-in string comparison mechanism, ===, and not a 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.

You can read more about timing attacks in Node.js on the Snyk blog.

CVSS Scores

version 3.1
Expand this section

Snyk

5.9 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None