CVE-2026-84308phpseclib — non-constant-time X25519 scalar multiplication permits full private-key…
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.
What to do
Fixed builds are available from Debian, Packagist: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | php-phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 26.10 | php-phpseclib3 | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 26.10 | phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 26.04 | php-phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 26.04 | php-phpseclib3 | Under investigation | UBUNTU-CVE-2026-84308 | |
| Ubuntu 26.04 | phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 24.04 | php-phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 24.04 | php-phpseclib3 | Under investigation | UBUNTU-CVE-2026-84308 | |
| Ubuntu 24.04 | phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 22.04 | php-phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 22.04 | php-phpseclib3 | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 22.04 | phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 20.04 | php-phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 20.04 | phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 18.04 | php-phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 18.04 | phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 16.04 | php-phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Ubuntu 16.04 | phpseclib | Fix pending | UBUNTU-CVE-2026-84308 | |
| Debian 14 | php-phpseclib3 | Fixed | 3.0.57-1 | DEBIAN-CVE-2026-84308 |
| Debian 14 | php-phpseclib4 | Fixed | 4.0.1-1 | DEBIAN-CVE-2026-84308 |
| Debian 13 | php-phpseclib3 | Fix pending | DEBIAN-CVE-2026-84308 | |
| Debian 12 | php-phpseclib3 | Fix pending | DEBIAN-CVE-2026-84308 | |
| Packagist library | phpseclib/phpseclib | Fixed | 4.0.1 | GHSA-q97c-8qh3-fpc6 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- phpseclib: affected: < 3.0.57, >= 4.0.0, < 4.0.1
References
- https://github.com/phpseclib/phpseclib/security/advisories/GHSA-q97c-8qh3-fpc6
- https://github.com/phpseclib/phpseclib/commit/fb56bc5bb9009b54a6c26b31aeec8ed944f17373
- https://github.com/phpseclib/phpseclib/releases/tag/3.0.57
- https://github.com/phpseclib/phpseclib/releases/tag/4.0.1
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.