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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | php-phpseclib | 2.0.42-1+deb12u4 | DEBIAN-CVE-2026-40194 |
| Debian:13 | php-phpseclib | 2.0.48-3+deb13u2 | DEBIAN-CVE-2026-40194 |
| Debian:14 | php-phpseclib | 2.0.53-1 | DEBIAN-CVE-2026-40194 |
| Debian:12 | php-phpseclib3 | 3.0.19-1+deb12u5 | DEBIAN-CVE-2026-40194 |
| Debian:13 | php-phpseclib3 | 3.0.43-2+deb13u2 | DEBIAN-CVE-2026-40194 |
| Debian:14 | php-phpseclib3 | 3.0.51-1 | DEBIAN-CVE-2026-40194 |
| Debian:12 | phpseclib | 1.0.20-1+deb12u4 | DEBIAN-CVE-2026-40194 |
| Debian:13 | phpseclib | 1.0.23-6+deb13u2 | DEBIAN-CVE-2026-40194 |
| Packagist | phpseclib/phpseclib | 1.0.28 | GHSA-r854-jrxh-36qx |
| Packagist | phpseclib/phpseclib | 2.0.53 | GHSA-r854-jrxh-36qx |
| Packagist | phpseclib/phpseclib | 3.0.51 | GHSA-r854-jrxh-36qx |
| Ubuntu:25.10 | php-phpseclib | no fix listed | UBUNTU-CVE-2026-40194 |
| Ubuntu:24.04:LTS | php-phpseclib3 | no fix listed | UBUNTU-CVE-2026-40194 |
| Ubuntu:25.10 | php-phpseclib3 | no fix listed | UBUNTU-CVE-2026-40194 |
| Ubuntu:26.04:LTS | php-phpseclib3 | no fix listed | UBUNTU-CVE-2026-40194 |
| Ubuntu:26.10 | php-phpseclib3 | no fix listed | UBUNTU-CVE-2026-40194 |
| Ubuntu:22.04:LTS | phpseclib | no fix listed | UBUNTU-CVE-2026-40194 |
| Ubuntu:25.10 | phpseclib | no fix listed | UBUNTU-CVE-2026-40194 |
| Ubuntu:26.10 | phpseclib | no fix listed | UBUNTU-CVE-2026-40194 |
Affected products (as reported)
Weakness: CWE-208 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
References
- https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx x_refsource_CONFIRM
- https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac x_refsource_MISC
- https://github.com/phpseclib/phpseclib/releases/tag/1.0.28 x_refsource_MISC
- https://github.com/phpseclib/phpseclib/releases/tag/2.0.53 x_refsource_MISC
- https://github.com/phpseclib/phpseclib/releases/tag/3.0.51 x_refsource_MISC