Security mailing lists by PureSourceCode

CVE-2026-40194

LOW 3.7CVSS 3.1

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
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

SourceScored byVersionScoreVector / 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

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD phpseclib phpseclib
cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:*
<= 1.0.27
NVD phpseclib phpseclib
cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:*
>= 2.0.0, < 2.0.53 2.0.53
NVD phpseclib phpseclib
cpe: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

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)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.