CVE-2026-40194

NameCVE-2026-40194
Descriptionphpseclib 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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
php-phpseclib (PTS)bullseye2.0.30-2+deb11u2vulnerable
bullseye (security)2.0.30-2+deb11u1vulnerable
bookworm2.0.42-1+deb12u5fixed
bookworm (security)2.0.42-1+deb12u3vulnerable
trixie2.0.48-3+deb13u3fixed
trixie (security)2.0.48-3+deb13u1vulnerable
sid2.0.54-1fixed
php-phpseclib3 (PTS)bookworm3.0.19-1+deb12u6fixed
bookworm (security)3.0.19-1+deb12u4vulnerable
trixie3.0.43-2+deb13u3fixed
trixie (security)3.0.43-2+deb13u1vulnerable
sid3.0.52-2fixed
phpseclib (PTS)bullseye1.0.19-3+deb11u2vulnerable
bullseye (security)1.0.19-3+deb11u3vulnerable
bookworm1.0.20-1+deb12u5fixed
bookworm (security)1.0.20-1+deb12u3vulnerable
trixie1.0.23-6+deb13u3fixed
trixie (security)1.0.23-6+deb13u1vulnerable
sid1.0.29-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
php-phpseclibsourcebookworm2.0.42-1+deb12u4
php-phpseclibsourcetrixie2.0.48-3+deb13u2
php-phpseclibsource(unstable)2.0.53-1
php-phpseclib3sourcebookworm3.0.19-1+deb12u5
php-phpseclib3sourcetrixie3.0.43-2+deb13u2
php-phpseclib3source(unstable)3.0.51-1
phpseclibsourcebookworm1.0.20-1+deb12u4
phpseclibsourcetrixie1.0.23-6+deb13u2
phpseclibsource(unstable)1.0.28-1

Notes

[bullseye] - phpseclib <postponed> (Minor issue)
https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx
Fixed by: https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac (3.0.51, 2.0.53, 1.0.28)

Search for package or bug name: Reporting problems