Information Exposure Through Timing Discrepancy Affecting paragonie/ecc package, versions <2.0.1
Threat Intelligence
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 SNYK-PHP-PARAGONIEECC-6689320
- published 12 Nov 2024
- disclosed 25 Apr 2024
- credit Unknown
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