CVE-2026-40194 | phpseclib 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: 2026-04-10 Last update: 2026-05-08 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2026-40194 is rated Low Risk (23.9/100): CVSS Low severity, with low exploitation likelihood (EPSS 0.33%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2026-40194

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.01% 0.33% +0.32%
2 2026-04-11 0.01%

Full EPSS history (2 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2026-40194

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
3.7 3.1 LOW
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:N)
Service keeps running; no real outage angle.
2.2 1.4 [email protected]

Weakness enumeration for CVE-2026-40194

GitHub Security Advisory for CVE-2026-40194

GHSA-r854-jrxh-36qx · Severity: low · Ecosystem: composer — phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()

OS Trackers for CVE-2026-40194

vendor priority summary link
debian not yet assigned CVE-2026-40194 not yet assigned priority: Debian including 3 source packages (php-phpseclib, php-phpseclib3, phpseclib), 13 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 11, open 2. https://security-tracker.debian.org/tracker/CVE-2026-40194
ubuntu medium CVE-2026-40194 medium priority: Ubuntu including 3 source packages (php-phpseclib, php-phpseclib3, phpseclib), 21 status rows across 8 suites (bionic, focal, jammy, noble, questing, resolute, upstream, xenial): needs-triage 19, released 2. https://ubuntu.com/security/CVE-2026-40194

Affected software / configurations for CVE-2026-40194

Vendor Product Version Raw CPE
phpseclib phpseclib <= 1.0.27 cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:*
phpseclib phpseclib >= 2.0.0, < 2.0.53 cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:*
phpseclib phpseclib >= 3.0.0, < 3.0.51 cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:*

References for CVE-2026-40194

cvelogic Threat Intelligence