{"id":"CVE-2026-40194","state":"PUBLISHED","title":"phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()","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.","publishedAt":"2026-04-10T20:24:06.696Z","updatedAt":"2026-05-08T15:18:43.231Z","severity":{"score":3.7,"label":"Low","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["phpseclib phpseclib"],"affected":[{"vendor":"phpseclib","product":"phpseclib","versions":[{"version":">= 0.1.1, < 1.0.28","status":"affected"},{"version":">= 2.0.0, < 2.0.53","status":"affected"},{"version":">= 3.0.0, < 3.0.51","status":"affected"}]}],"references":["https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx","https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac","https://github.com/phpseclib/phpseclib/releases/tag/1.0.28","https://github.com/phpseclib/phpseclib/releases/tag/2.0.53","https://github.com/phpseclib/phpseclib/releases/tag/3.0.51"],"weaknesses":["CWE-208"],"ingestedAt":"2026-10-29T20:11:57.932Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/40xxx/CVE-2026-40194.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-40194","state":"PUBLISHED","datePublished":"2026-04-10T20:24:06.696Z","dateUpdated":"2026-05-08T15:18:43.231Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-04-09T20:59:17.620Z"},"containers":{"cna":{"title":"phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()","descriptions":[{"lang":"en","value":"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":[{"vendor":"phpseclib","product":"phpseclib","versions":[{"version":">= 0.1.1, < 1.0.28","status":"affected"},{"version":">= 2.0.0, < 2.0.53","status":"affected"},{"version":">= 3.0.0, < 3.0.51","status":"affected"}]}],"references":[{"url":"https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx","name":"https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac","name":"https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac","tags":["x_refsource_MISC"]},{"url":"https://github.com/phpseclib/phpseclib/releases/tag/1.0.28","name":"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","name":"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","name":"https://github.com/phpseclib/phpseclib/releases/tag/3.0.51","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"NETWORK","availabilityImpact":"NONE","baseScore":3.7,"baseSeverity":"LOW","confidentialityImpact":"LOW","integrityImpact":"NONE","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-208","lang":"en","description":"CWE-208: Observable Timing Discrepancy","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-05-08T15:18:43.231Z"},"source":{"advisory":"GHSA-r854-jrxh-36qx","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-04-13T15:28:24.152831Z","id":"CVE-2026-40194","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-04-13T15:35:24.775Z"}}]}}}