PHPECC Vulnerable to Multiple Cryptographic Side-Channel Attacks
Summary
GHSA-346h-749j-r28w: PHPECC vulnerable to multiple cryptographic side-channel attacks. Affects mdanter/ecc versions < 1.0.0. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PHPECC is a package available on Packagist that provides functionality for elliptic curve cryptography (ECC) in PHP. It is used for generating and verifying ECDSA signatures, as well as performing scalar-point multiplication for ECDH key exchange. However, the package is vulnerable to multiple cryptographic side-channel attacks.
Vulnerability Detail
The vulnerability in PHPECC stems from several issues. Firstly, it is susceptible to malleable ECDSA signature attacks, which can lead to the manipulation of signatures. Additionally, the package uses the GMPMath adapter, which wraps the GNU Multiple Precision arithmetic library (GMP). However, GMP does not provide constant-time implementations of algorithms, making it vulnerable to timing attacks. An attacker who can observe the time it takes to perform signature operations can leak the secret number and ultimately learn the private key. Furthermore, the scalar-point multiplication in the EcDH class is based on the arithmetic defined by the Point class. Although a Montgomery ladder is implemented, certain methods in the Point class, such as add(), mul(), and getDouble(), are not constant-time. This results in timing leaks that expose information about each bit of the private key.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
Currently, there is no known workaround for this vulnerability. It is crucial to update the package to a secure version as soon as possible.
Conclusion
PHPECC is vulnerable to multiple cryptographic side-channel attacks, including malleable ECDSA signature attacks and timing leaks in scalar-point multiplication. It is crucial to update the package to a secure version as soon as possible to mitigate these vulnerabilities. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for mdanter/ecc →
FAQ
PHPECC is a package that provides functionality for elliptic curve cryptography (ECC) in PHP. It is used for generating and verifying ECDSA signatures, as well as performing scalar-point multiplication for ECDH key exchange.
ECDSA (Elliptic Curve Digital Signature Algorithm) is a cryptographic algorithm used to create digital signatures. It is based on the mathematics of elliptic curves and provides a way to verify the authenticity and integrity of data.
Malleable ECDSA signature attacks refer to the ability to manipulate ECDSA signatures in a way that does not invalidate their authenticity. This can lead to various security issues, such as impersonation or the creation of different valid signatures for the same message.
A timing side-channel attack is a type of attack that exploits the variations in execution time or other timing characteristics of a system to gain information about sensitive data. In the case of PHPECC, timing side-channel attacks can be used to leak the secret number and private key.
ECDH (Elliptic Curve Diffie-Hellman) key exchange is a method for two parties to establish a shared secret over an insecure channel. It is based on the Diffie-Hellman key exchange protocol and uses elliptic curve cryptography to perform scalar-point multiplication.