safe-compare@1.1.2 vulnerabilities

Constant-time comparison algorithm to prevent timing attacks.

  • latest version

    1.1.4

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    6 years ago

  • licenses detected

  • Direct Vulnerabilities

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

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable 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