Information Exposure Through Timing Discrepancy Affecting mdanter/ecc package, versions >=0.0.0
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-MDANTERECC-6674064
- published 26 Apr 2024
- disclosed 25 Apr 2024
- credit Unknown
How to fix?
There is no fixed version for mdanter/ecc
.
Overview
mdanter/ecc is a PHP 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