CVE-2026-84308
phpseclib — non-constant-time X25519 scalar multiplication permits full private-key recovery
Check your servers for CVE-2026-84308
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-84308 affects phpseclib, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- high: an attack depends on conditions outside the control of the attacker, such as a race
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.32%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 26.7% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 3 Sep 2026):
- Exploitation
- poc: a proof of concept is public
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Weakness
Affected products
As the CNA lists them.
Is my server affected?
Find the installed version of phpseclib and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i phpseclib
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2026-84308 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2026-84308RHEL, Rocky, Alma, Fedora
rpm -q phpseclib
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2026-84308Alpine
apk list --installed | grep -i phpseclibWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2026-84308
trivy image --scanners vuln IMAGE | grep CVE-2026-84308
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Exploits and proof of concept
- https://github.com/phpseclib/phpseclib/security/advisories/GHSA-q97c-8qh3-fpc6 github.com · exploit
Other references
- https://github.com/phpseclib/phpseclib/commit/fb56bc5bb9009b54a6c26b31aeec8ed944f17373 github.com
- https://github.com/phpseclib/phpseclib/releases/tag/3.0.57 github.com
- https://github.com/phpseclib/phpseclib/releases/tag/4.0.1 github.com
Source: the record CVE-2026-84308 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse