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

Low 3.7 Published Updated

An attacker can exploit a timing side-channel in SSH packet verification to potentially recover sensitive data or forge packets.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-40194?

CVE-2026-40194 is a low-severity vulnerability in phpseclib, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-208

Which versions are affected by CVE-2026-40194?

6 open source packages ship an affected version, including phpseclib/phpseclib. It affects 1 product.

PackageAffectedFixed in
phpseclib/phpseclib PackagistFrom 0.1.11.0.28
phpseclib/phpseclib PackagistFrom 0.1.11.0.28
phpseclib/phpseclib PackagistFrom 2.0.02.0.53
phpseclib/phpseclib PackagistFrom 2.0.02.0.53
phpseclib/phpseclib PackagistFrom 3.0.03.0.51
phpseclib/phpseclib PackagistFrom 3.0.03.0.51

Products include Phpseclib Phpseclib.

How do I fix CVE-2026-40194?

Upgrade phpseclib/phpseclib to a fixed version for your release line: 1.0.28, 2.0.53 or 3.0.51.

Is CVE-2026-40194 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40194 exists.

Sources

Also known as CLSA-2026-1779410885, DEBIAN-CVE-2026-40194, GHSA-r854-jrxh-36qx, UBUNTU-CVE-2026-40194.

Is CVE-2026-40194 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free