CVE-2026-40194
LOW 3.7CVSS 3.1phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()
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.
- Published
- 10 Apr 2026
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-208
- Also known as
- GHSA-r854-jrxh-36qx
- Sources
- NVDJSONOSV GHSA-r854-jrxh-36qxJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | LOW 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N |
| OSV | GitHub | CVSS 3.1 | LOW 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | phpseclib | phpseclibcpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:* |
<= 1.0.27 | |
| NVD | phpseclib | phpseclibcpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:* |
>= 2.0.0, < 2.0.53 | 2.0.53 |
| NVD | phpseclib | phpseclibcpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:* |
>= 3.0.0, < 3.0.51 | 3.0.51 |
| OSV | Packagist | phpseclib/phpseclib | >= 0.1.1, < 1.0.28 | 1.0.28 |
| OSV | Packagist | phpseclib/phpseclib | >= 2.0.0, < 2.0.53 | 2.0.53 |
| OSV | Packagist | phpseclib/phpseclib | >= 3.0.0, < 3.0.51 | 3.0.51 |
References
- https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac · Patch, WEB
- https://github.com/phpseclib/phpseclib/releases/tag/1.0.28 · Release Notes, WEB
- https://github.com/phpseclib/phpseclib/releases/tag/2.0.53 · Release Notes, WEB
- https://github.com/phpseclib/phpseclib/releases/tag/3.0.51 · Release Notes, WEB
- https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx · Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-40194 · ADVISORY
- https://github.com/phpseclib/phpseclib · PACKAGE
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 10 Apr 2026)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 10 Apr 2026)