CVE-2026-40194 Details
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.
A vulnerability exists in the phpseclib library's SSH2 component, specifically in the HMAC verification process of the 'get_binary_packet' method'. This issue is present in versions prior to 3.0.51, 2.0.53, and 1.0.28. The vulnerability arises because the library uses PHP's '!=' operator to compare HMACs, which introduces a variable-time comparison flaw. This behavior can be exploited to create a timing attack, although such exploitation is impractical in a real-world SSH context due to the protocol's inherent protections.
Users can upgrade to phpseclib versions 3.0.51, 2.0.53, or 1.0.28, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 13, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-208 | Observable Timing Discrepancy | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| phpseclib phpseclib | <= 1.0.27 >= 2.0.0, < 2.0.53 >= 3.0.0, < 3.0.51 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 8, 2026 | CVE Modified | [email protected] |
| Apr 21, 2026 | Initial Analysis | [email protected] |
| Apr 13, 2026 | CVE Modified | CISA-ADP |
| Apr 10, 2026 | New CVE Received | [email protected] |