safe-compare@1.1.2 vulnerabilities

Constant-time comparison algorithm to prevent timing attacks.

Direct Vulnerabilities

Known vulnerabilities in the safe-compare package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • L
Timing Attack

safe-compare is a Constant-time comparison algorithm to prevent Node.js timing attacks.

Affected versions of this package are vulnerable to Timing Attack via the nativeTimingSafeEqual function which could leak the length of a user password. This is caused by always choosing the length of the longer string when comparing.

How to fix Timing Attack?

Upgrade safe-compare to version 1.1.4 or higher.

>=1.0.4 <1.1.4