Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. phpseclib
  4. ›
  5. CVE-2026-84308

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

September 8, 2026

The pure-PHP X25519 scalar multiplication in phpseclib is not constant-time. Field addition and subtraction each perform a data-dependent conditional modular reduction, so the cost of each Montgomery-ladder step is a linear function of that step’s reduction count which is a quantity determined by the secret scalar’s prefix.

An observer with per-ladder-step resolution recovers the 251-bit clamped private scalar. This is a per-step leak, not an aggregate one: an instrumented code proof-of-concept recovers 20/20 test keys from 32 observed operations, and an observer that counts libgmp calls instead of timing them recovers a key from a single operation.

This is not a low-order-input issue. Recovery works with the RFC 7748 base point u = 9, with no attacker-chosen input at all. Rejecting low-order public values does not close it.

References

  • github.com/advisories/GHSA-q97c-8qh3-fpc6
  • github.com/phpseclib/phpseclib/commit/fb56bc5bb9009b54a6c26b31aeec8ed944f17373
  • github.com/phpseclib/phpseclib/releases/tag/3.0.57
  • github.com/phpseclib/phpseclib/releases/tag/4.0.1
  • github.com/phpseclib/phpseclib/security/advisories/GHSA-q97c-8qh3-fpc6
  • nvd.nist.gov/vuln/detail/CVE-2026-84308

Code Behaviors & Features

Detect and mitigate CVE-2026-84308 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.0.57, all versions starting from 4.0.0 before 4.0.1

Fixed versions

  • 3.0.57
  • 4.0.1

Solution

Upgrade to versions 3.0.57, 4.0.1 or above.

Impact 6.3 MEDIUM

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-208: Observable Timing Discrepancy
  • CWE-385: Covert Timing Channel

Source file

packagist/phpseclib/CVE-2026-84308.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:22 +0000.