Live threats

All CVEs / Phpseclib

CVE-2026-40194Phpseclib

Low 3.7 No auth needed

Priority
37
CVSS 3.1
3.7
EPSS
—
Auth required
No
Published
Apr 10, 2026
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-208
SSVC (CISA)
Exploitation: proof of concept · Automatable: no · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

What happens

phpseclib is a PHP secure communications library. Starting in 0.1.1 and prior to 3.0.51, 2.0.53, and 1.0.28, phpseclib\Net\SSH2::get_binary_packet() uses PHP's != operator to compare a received SSH packet HMAC against the locally computed HMAC. != on equal-length binary strings in PHP uses memcmp(), which short-circuits on the first differing byte. This is a real variable-time comparison (CWE-208), proven by scaling benchmarks. This vulnerability is fixed in 3.0.51, 2.0.53, and 1.0.28.

Original NVD text.

What to do

  1. Apply the vendor's security update for Phpseclib.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
Packagist phpseclib/phpseclib ≥ 0.1.1 < 1.0.28 1.0.28 composer require "phpseclib/phpseclib:^1.0.28"
Packagist phpseclib/phpseclib ≥ 2.0.0 < 2.0.53 2.0.53 composer require "phpseclib/phpseclib:^2.0.53"
Packagist phpseclib/phpseclib ≥ 3.0.0 < 3.0.51 3.0.51 composer require "phpseclib/phpseclib:^3.0.51"

Per OSV / GitHub Advisories (GHSA-r854-jrxh-36qx). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
phpseclibphpseclib≤ 1.0.27
phpseclibphpseclib≥ 2.0.0 < 2.0.53
phpseclibphpseclib≥ 3.0.0 < 3.0.51

Official sources

References

Links published by the sources. Open them with care.