CVE Catalog

CVE-2026-84308

MediumCVSS 6.3
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.21%

11th percentile - higher than 11% of all known CVEs

Summary

phpseclib before 3.0.57 and 4.0.1 performs pure-PHP X25519 scalar multiplication with data-dependent conditional modular reductions in add() and subtract(). During the Montgomery ladder, reduction behavior depends on the secret scalar prefix, creating observable timing and libgmp call-count differences that can reveal a reused 251-bit clamped private scalar.

Risk Assessment

If an X25519 private key is reused or long-lived, a local observer can recover the scalar, permanently compromising operations that reuse that key. Ephemeral keys, including phpseclib's normal SSH exchange path, are not affected.

Recommendation

Update phpseclib to version 3.0.57 or 4.0.1 (or later), and avoid reusing long-lived X25519 keys in contexts susceptible to local observation.

Other vulnerabilities in phpseclib

Original NVD description (English source)

phpseclib is a PHP secure communications library. Prior to 3.0.57 and 4.0.1, pure-PHP X25519 scalar multiplication in phpseclib/Math/PrimeField/Integer.php performs data-dependent conditional modular reductions in add() and subtract(). During the Montgomery ladder in phpseclib/Crypt/EC/BaseCurves/Montgomery.php, the reduction behavior of each step depends on the secret scalar prefix, creating per-step timing and libgmp call-count observations that can reveal a reused 251-bit clamped private scalar. The phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php derivation path invokes the pure-PHP multiplication without a native-engine check, while phpseclib/Crypt/EC/Formats/Keys/PKCS8.php reaches it when ext-sodium is unavailable. Exploitation requires a reused or long-lived X25519 private key, knowledge of the corresponding public key, execution of the pure-PHP path, and a local observer capable of resolving individual ladder steps or libgmp entry-point calls. Ephemeral X25519 keys, including phpseclib's normal SSH exchange path, are not affected. Recovery of the scalar permanently compromises operations that reuse that key. This issue is fixed in versions 3.0.57 and 4.0.1.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS