CVE-2026-40194

NameCVE-2026-40194
Descriptionphpseclib 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.
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+deb12u2vulnerable
bookworm (security)2.0.42-1+deb12u3vulnerable
trixie2.0.48-3vulnerable
trixie (security)2.0.48-3+deb13u1vulnerable
forky, sid2.0.52-1vulnerable
php-phpseclib3 (PTS)bookworm3.0.19-1+deb12u3vulnerable
bookworm (security)3.0.19-1+deb12u4vulnerable
trixie3.0.43-2vulnerable
trixie (security)3.0.43-2+deb13u1vulnerable
forky, sid3.0.50-1vulnerable
phpseclib (PTS)bullseye1.0.19-3+deb11u2vulnerable
bullseye (security)1.0.19-3+deb11u3vulnerable
bookworm1.0.20-1+deb12u2vulnerable
bookworm (security)1.0.20-1+deb12u3vulnerable
trixie1.0.23-6vulnerable
trixie (security)1.0.23-6+deb13u1vulnerable
sid1.0.27-1vulnerable

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

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
php-phpseclibsource(unstable)(unfixed)
php-phpseclib3source(unstable)(unfixed)
phpseclibsource(unstable)(unfixed)

Notes

[trixie] - php-phpseclib3 <no-dsa> (Minor issue)
[bookworm] - php-phpseclib3 <no-dsa> (Minor issue)
[trixie] - php-phpseclib <no-dsa> (Minor issue)
[bookworm] - php-phpseclib <no-dsa> (Minor issue)
[trixie] - phpseclib <no-dsa> (Minor issue)
[bookworm] - phpseclib <no-dsa> (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