Information Exposure Through Timing Discrepancy Affecting paragonie/ecc package, versions <2.0.1


Severity

Recommended
0.0
critical
0
10

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

Threat Intelligence

EPSS
0.04% (12th percentile)

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-PHP-PARAGONIEECC-6689320
  • published12 Nov 2024
  • disclosed25 Apr 2024
  • creditUnknown

Introduced: 25 Apr 2024

CVE-2024-33851  (opens in a new tab)
CWE-203  (opens in a new tab)
CWE-354  (opens in a new tab)

How to fix?

Upgrade paragonie/ecc to version 2.0.1 or higher.

Overview

paragonie/ecc is an Elliptic Curve Cryptography library

Affected versions of this package are vulnerable to Information Exposure Through Timing Discrepancy due to the use of the GMPMath adapter, which wraps the GNU Multiple Precision arithmetic library (GMP) not aiming to provide constant-time implementations of algorithms. An attacker capable of triggering many signatures and studying the time it takes to perform each operation could leak the secret number, k, and thereby learn the private key.

Additionally, when calculating a shared secret using the EcDH class, the scalar-point multiplication is based on the arithmetic defined by the Point class. Despite the implementation of a Montgomery ladder, the add(), mul(), and getDouble() methods on the Point class are not constant-time, leading to the leakage of information about each bit of the ECDH private keys through a timing side-channel.

Note:

This vulnerability is fixed in the 2.0.0 version of the forked package paragonie/ecc

CVSS Scores

version 3.1