CVE-2026-40194
Modified
Modified - Updated After Analysis
Timing Side-Channel in phpseclib SSH2 HMAC Comparison
Publication date: 2026-04-10
Last updated on: 2026-05-08
Assigner: GitHub, Inc.
Description
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.
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| phpseclib | phpseclib | to 1.0.27 (inc) |
| phpseclib | phpseclib | From 2.0.0 (inc) to 2.0.53 (exc) |
| phpseclib | phpseclib | From 3.0.0 (inc) to 3.0.51 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-208 | Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not. |