Skip to content

← Actionable
Medium, CVSS 6.3amended

phpseclib — non-constant-time X25519 scalar multiplication permits full private-key recovery

CVE-2026-84308GHSA-q97c-8qh3-fpc6

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (phpseclib/phpseclib 4.0.1, 3.0.57), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
6.3 · CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
EPSS
  • CVE-2026-84308: 0.33% estimated exploitation activity in the next 30 days; percentile 25.84 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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. 2. Affected component Confirmed on phpseclib 3.0.56 (338 files under phpseclib/,sha256(sorted(relpath NUL filesha256 LF)) =…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-q97c-8qh3-fpc6

  2. Revision 1 · created ·

    Published from osv record GHSA-q97c-8qh3-fpc6

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-84308

Advisory: phpseclib — non-constant-time X25519 scalar multiplication permits full private-key recovery
IDs: CVE-2026-84308, GHSA-q97c-8qh3-fpc6
Record: https://patchnext.com/advisories/cve-2026-84308 (revision 2, source checked 26 Oct 2026, 14:53 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 6.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: phpseclib/phpseclib 4.0.1, 3.0.57. A vendor fix does not mean a deployment is fixed.

## Affected components
- Packagist phpseclib/phpseclib: affected < 3.0.57; >= 4.0.0, < 4.0.1; fixed in 3.0.57, 4.0.1

## Suggested inspection (read-only)
- Packagist phpseclib/phpseclib: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on phpseclib/phpseclib.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-q97c-8qh3-fpc6 (OSV record GHSA-q97c-8qh3-fpc6 lists affected ranges: Packagist phpseclib/phpseclib >=0 =4.0.0 <4.0.1 (fixed))
- Verified: https://github.com/advisories/GHSA-q97c-8qh3-fpc6 (GitHub-reviewed advisory GHSA-q97c-8qh3-fpc6 lists affected ranges: Packagist phpseclib/phpseclib >=0 =4.0.0 <4.0.1)

Commands are suggestions: review each one before running it.

Loading voting…