CVE-2026-84308

NameCVE-2026-84308
Descriptionphpseclib 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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
php-phpseclib (PTS)bookworm2.0.42-1+deb12u5fixed
bookworm (security)2.0.42-1+deb12u3fixed
trixie2.0.48-3+deb13u3fixed
trixie (security)2.0.48-3+deb13u1fixed
forky, sid2.0.55-1fixed
php-phpseclib3 (PTS)bookworm3.0.19-1+deb12u6vulnerable
bookworm (security)3.0.19-1+deb12u4vulnerable
trixie3.0.43-2+deb13u3vulnerable
trixie (security)3.0.43-2+deb13u1vulnerable
forky, sid3.0.57-1fixed
php-phpseclib4 (PTS)forky, sid4.0.1-1fixed
phpseclib (PTS)bookworm1.0.20-1+deb12u5fixed
bookworm (security)1.0.20-1+deb12u3fixed
trixie1.0.23-6+deb13u3fixed
trixie (security)1.0.23-6+deb13u1fixed
sid1.0.30-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
php-phpseclibsource(unstable)(not affected)
php-phpseclib3source(unstable)3.0.57-1
php-phpseclib4source(unstable)4.0.1-1
phpseclibsource(unstable)(not affected)

Notes

- php-phpseclib <not-affected> (Vulnerable code not present)
- phpseclib <not-affected> (Vulnerable code not present)
https://github.com/phpseclib/phpseclib/security/advisories/GHSA-q97c-8qh3-fpc6
Fixed by: https://github.com/phpseclib/phpseclib/commit/fb56bc5bb9009b54a6c26b31aeec8ed944f17373 (4.0.1, 3.0.57)

Search for package or bug name: Reporting problems