Vulnerability · Published Apr 10, 2026 · Assigned by GitHub_M

CVE-2026-40194phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()

Low 3.7

In plain English

A low-severity security flaw in phpseclib from phpseclib. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 30% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)3.7Low
Exploit odds (30 days)0.4%top 69.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12php-phpseclib2.0.42-1+deb12u4DEBIAN-CVE-2026-40194
Debian:13php-phpseclib2.0.48-3+deb13u2DEBIAN-CVE-2026-40194
Debian:14php-phpseclib2.0.53-1DEBIAN-CVE-2026-40194
Debian:12php-phpseclib33.0.19-1+deb12u5DEBIAN-CVE-2026-40194
Debian:13php-phpseclib33.0.43-2+deb13u2DEBIAN-CVE-2026-40194
Debian:14php-phpseclib33.0.51-1DEBIAN-CVE-2026-40194
Debian:12phpseclib1.0.20-1+deb12u4DEBIAN-CVE-2026-40194
Debian:13phpseclib1.0.23-6+deb13u2DEBIAN-CVE-2026-40194
Packagistphpseclib/phpseclib1.0.28GHSA-r854-jrxh-36qx
Packagistphpseclib/phpseclib2.0.53GHSA-r854-jrxh-36qx
Packagistphpseclib/phpseclib3.0.51GHSA-r854-jrxh-36qx
Ubuntu:25.10php-phpseclibno fix listedUBUNTU-CVE-2026-40194
Ubuntu:24.04:LTSphp-phpseclib3no fix listedUBUNTU-CVE-2026-40194
Ubuntu:25.10php-phpseclib3no fix listedUBUNTU-CVE-2026-40194
Ubuntu:26.04:LTSphp-phpseclib3no fix listedUBUNTU-CVE-2026-40194
Ubuntu:26.10php-phpseclib3no fix listedUBUNTU-CVE-2026-40194
Ubuntu:22.04:LTSphpseclibno fix listedUBUNTU-CVE-2026-40194
Ubuntu:25.10phpseclibno fix listedUBUNTU-CVE-2026-40194
Ubuntu:26.10phpseclibno fix listedUBUNTU-CVE-2026-40194

Affected products (as reported)

VendorProductVersions
phpseclib phpseclib >= 0.1.1, < 1.0.28>= 2.0.0, < 2.0.53>= 3.0.0, < 3.0.51

Weakness: CWE-208 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

References