CVE-2026-40194 phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()
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.
| Package | Affected | Fixed in |
|---|---|---|
phpseclib/phpseclib Packagist | From 0.1.1 | 1.0.28 |
phpseclib/phpseclib Packagist | From 0.1.1 | 1.0.28 |
phpseclib/phpseclib Packagist | From 2.0.0 | 2.0.53 |
phpseclib/phpseclib Packagist | From 2.0.0 | 2.0.53 |
phpseclib/phpseclib Packagist | From 3.0.0 | 3.0.51 |
phpseclib/phpseclib Packagist | From 3.0.0 | 3.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.
Other vulnerabilities in phpseclib
- CVE-2026-32935 phpseclib's AES-CBC unpadding susceptible to padding oracle timing attack
- CVE-2023-52892 Name confusion in x509 Subject Alternative Name fields
- CVE-2023-49316 Phpseclib needs guardrails on large binaryfield integers
- CVE-2023-27560 phpseclib Infinite Loop vulnerability
- CVE-2026-55599 phpseclib: X.509 certificate validation sends attacker-controlled outbound requests (server-side request forgery) via Authority Information Access
Sources
Also known as CLSA-2026-1779410885, DEBIAN-CVE-2026-40194, GHSA-r854-jrxh-36qx, UBUNTU-CVE-2026-40194.