{"id":"CVE-2026-40194","published":"2026-04-10T20:24:06Z","modified":"2026-05-08T15:18:43Z","title":"phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()","vendor":"phpseclib","product":"phpseclib","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":3.7,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00368,"percentile":0.31436,"provenance":"source"},"cwes":[{"id":"CWE-208","name":"Observable Timing Discrepancy"}],"references":[{"url":"https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac","tags":["x_refsource_MISC"]},{"url":"https://github.com/phpseclib/phpseclib/releases/tag/1.0.28","tags":["x_refsource_MISC"]},{"url":"https://github.com/phpseclib/phpseclib/releases/tag/2.0.53","tags":["x_refsource_MISC"]},{"url":"https://github.com/phpseclib/phpseclib/releases/tag/3.0.51","tags":["x_refsource_MISC"]}],"priority":{"score":8.9,"factors":[{"name":"EPSS percentile","points":6.29},{"name":"CVSS severity","points":2.59}]},"vendorSlug":"phpseclib","affectedVersions":[{"vendor":"phpseclib","product":"phpseclib","versions":[">= 0.1.1, < 1.0.28",">= 2.0.0, < 2.0.53",">= 3.0.0, < 3.0.51"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-04-13T15:28:24.152831Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"phpseclib/phpseclib","vulnerableRanges":[">=0.1.1, <1.0.28",">=2.0.0, <2.0.53",">=3.0.0, <3.0.51"],"patched":["1.0.28","2.0.53","3.0.51"],"from":["GHSA-r854-jrxh-36qx"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-21597","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-27354","published":"2024-03-01","fixed":"3.0.36","kev":false},{"cve":"CVE-2024-27355","published":"2024-03-01","fixed":"3.0.36","kev":false},{"cve":"CVE-2026-32935","published":"2026-03-20","fixed":"3.0.50","kev":false,"link":{"from":"CVE-2026-32935","to":"CVE-2026-40194","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:phpseclib/phpseclib","fromFixed":"1.0.27","toFixed":"1.0.28","daysApart":21},{"kind":"version-step","provenance":"source","package":"Packagist:phpseclib/phpseclib","fromFixed":"2.0.52","toFixed":"2.0.53","daysApart":21}]}},{"cve":"CVE-2026-40194","published":"2026-04-10","fixed":"3.0.51","kev":false},{"cve":"CVE-2026-44167","published":"2026-05-12","fixed":"3.0.52","kev":false,"link":{"from":"CVE-2026-40194","to":"CVE-2026-44167","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:phpseclib/phpseclib","fromFixed":"1.0.28","toFixed":"1.0.29","daysApart":32},{"kind":"version-step","provenance":"source","package":"Packagist:phpseclib/phpseclib","fromFixed":"2.0.53","toFixed":"2.0.54","daysApart":32}]}},{"cve":"CVE-2026-55599","published":"2026-06-22","fixed":"3.0.54","kev":false},{"cve":"CVE-2026-84308","published":"2026-09-01","fixed":"4.0.1","kev":false}],"package":"Packagist:phpseclib/phpseclib"}}