# CVE-2026-84308: phpseclib — non-constant-time X25519 scalar multiplication permits full private-key recovery

- Severity: Medium 6.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.32%, higher than 26% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-09-01T19:28:09.378Z
- Modified: 2026-09-29T21:30:09.074Z
- Also known as: GHSA-q97c-8qh3-fpc6
- Weaknesses: CWE-208, CWE-385
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- phpseclib phpseclib: < 3.0.57; >= 4.0.0, < 4.0.1
- phpseclib/phpseclib (Packagist): before 3.0.57; from 4.0.0 before 4.0.1

## Every score

- GitHub_M: CVSS:3.1 6.3 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 6.3 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N`

## References

- <https://github.com/phpseclib/phpseclib/security/advisories/GHSA-q97c-8qh3-fpc6> (exploit, web)
- <https://github.com/phpseclib/phpseclib/commit/fb56bc5bb9009b54a6c26b31aeec8ed944f17373> (web)
- <https://github.com/phpseclib/phpseclib/releases/tag/3.0.57> (web)
- <https://github.com/phpseclib/phpseclib/releases/tag/4.0.1> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-84308> (advisory)
- <https://github.com/phpseclib/phpseclib> (package)

## Sources

- CVE List: [CVE-2026-84308](https://www.cve.org/CVERecord?id=CVE-2026-84308), CVE Terms of Use, modified 2026-09-03
- GitHub Advisory Database: [GHSA-q97c-8qh3-fpc6](https://github.com/advisories/GHSA-q97c-8qh3-fpc6), CC-BY-4.0, modified 2026-09-29
- NVD: [CVE-2026-84308](https://nvd.nist.gov/vuln/detail/CVE-2026-84308), Public domain, modified 2026-09-09

---

Page: https://cve.day/CVE-2026-84308 · Whole record: https://cve.day/CVE-2026-84308.json · Rebuilt by cve.day 2026-11-25T22:59:36.014Z
