CVE-2026-40194
published low CVSS 3.1 · 3.7phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| phpseclib | — | phpseclib>= 0.1.1, < 1.0.28 · >= 2.0.0, < 2.0.53 · >= 3.0.0, < 3.0.51 | Affected | Not stated | GitHub_M |
| Alpine Linux | edge | cacti | Fixed | 1.2.31-r0 | Package fix record |
| Debian | bullseye | php-phpseclib | Advisory build | 2.0.30-2+deb11u3 | DLA-4670-1 |
| Ubuntu | bionic | php-phpseclib | Advisory build | 2.0.9-1ubuntu0.1~esm3 | USN-8830-1 |
| Alpine Linux | v3.24 | cacti | Fixed | 1.2.31-0 | Package fix record |
| Ubuntu | focal | php-phpseclib | Advisory build | 2.0.23-2ubuntu0.1~esm3 | USN-8830-1 |
| Ubuntu | jammy | php-phpseclib | Advisory build | 2.0.36-1ubuntu0.1~esm3 | USN-8830-1 |
| Ubuntu | noble | php-phpseclib | Advisory build | 2.0.47-1ubuntu0.1~esm1 | USN-8830-1 |
Show 2 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | resolute | php-phpseclib | Advisory build | 2.0.51-1ubuntu0.1~esm1 | USN-8830-1 |
| Ubuntu | xenial | php-phpseclib | Advisory build | 2.0.1-1ubuntu0.1~esm1 | USN-8830-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 3.7 / 10
- Severity
- low
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| phpseclib | phpseclib | >= 0.1.1, < 1.0.28 (affected)>= 2.0.0, < 2.0.53 (affected)>= 3.0.0, < 3.0.51 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-208 CWE-208: Observable Timing Discrepancy
References
5- 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
- https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx
Provider assertions
2GitHub_M · cna
phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 2bfc5eaf60d93eecc44dc361ca9b22126a6c73d3e6e3393c2055ccc4184d70f5
- Ingested
- 23 Sep 2026, 09:13:02 UTC
- Source record
- Official CVE record