CVE-2026-40194

phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()

LOW
3.7
CVSS Score
Published: April 10, 2026 at 08:24 PM UTC
Updated: June 17, 2026 at 10:44 AM UTC
1 product affected across 1 vendorPhpseclib

Using phpseclib by phpseclib?

Get instant alerts when new vulnerabilities affect phpseclib - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
LOW3.7
Exploit prediction
EPSS 0.4%
SSVC
PoC

Description

phpseclib is a PHP secure communications library. 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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≤ 1.0.27v < 1.0.28v < 2.0.53v < 3.0.512.0.0 ≤ v < 2.0.533.0.0 ≤ v < 3.0.51
Affected range stops below 1.0.28, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.0.53, so it looks safe — our inference, not a vendor statement
Affected range stops below 3.0.51, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (5)

x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/phpseclib/phpseclib/releases/tag/1.0.28
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/phpseclib/phpseclib/releases/tag/2.0.53
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/phpseclib/phpseclib/releases/tag/3.0.51

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

3.7LOWGitHub_M
Attack Vector
NETWORK
Complexity
HIGH
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
LOW
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-208

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card