CVE-2026-84308 phpseclib — non-constant-time X25519 scalar multiplication permits full private-key recovery
Attackers can recover private X25519 keys via timing side-channels in pure-PHP scalar multiplication when keys are reused and native extensions are unavailable.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-84308?
CVE-2026-84308 is a medium-severity vulnerability in phpseclib, published on 1 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
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.
Which versions are affected by CVE-2026-84308?
4 open source packages ship an affected version, including phpseclib/phpseclib.
| Package | Affected | Fixed in |
|---|---|---|
phpseclib/phpseclib Packagist | All versions | 3.0.57 |
phpseclib/phpseclib Packagist | All versions | 3.0.57 |
phpseclib/phpseclib Packagist | From 4.0.0 | 4.0.1 |
phpseclib/phpseclib Packagist | From 4.0.0 | 4.0.1 |
How do I fix CVE-2026-84308?
Upgrade phpseclib/phpseclib to a fixed version for your release line: 3.0.57 or 4.0.1.
Is CVE-2026-84308 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-84308 exists.
Sources
Also known as DEBIAN-CVE-2026-84308, GHSA-q97c-8qh3-fpc6, MINI-c848-5gw4-2v8w, MINI-mp2x-7hpr-gw64, MINI-pm2h-3443-j64j, UBUNTU-CVE-2026-84308.