CVE 3.7 LOW

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

3.7 / 10
LOW
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

Description

phpseclib is a PHP secure communications library. 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.

Basic Information

ID CVE-2026-40194
Source GitHub_M
Published Apr 10, 2026 at 20:24

Affected Product

Vendor phpseclib
Product phpseclib
Version < 1.0.28
Affected Versions phpseclib phpseclib < 1.0.28
phpseclib phpseclib >= 2.0.0, < 2.0.53
phpseclib phpseclib >= 3.0.0, < 3.0.51

CWE Classification

References

💭 Join the Security Discussion

🔒 Your email address will not be published. Required fields are marked *

⚠️ Please be respectful and constructive in your comments. Security discussions should remain professional.