Skip to main content

Php phpseclib: 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… (CVE-2026-40194)

0
Medium
Published: 04/10/2026 (04/10/2026, 21:16:00 UTC)
Source: GCVE Database
Product: php-phpseclib

Description

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.

CVSS v3.1

Score 3.7low

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

Affected software

Ubuntu:Pro:16.04:LTSmore threats →ghsa
php-phpseclib
pkg:deb/ubuntu/php-phpseclib?arch=source&distro=esm-apps-legacy/xenial
Affected versions
<2.0.1-1ubuntu0.1~esm1=2.0.1-1=2.0.1-1build1
Ubuntu:Pro:16.04:LTSmore threats →ghsa
phpseclib
pkg:deb/ubuntu/phpseclib?arch=source&distro=esm-apps-legacy/xenial
Affected versions
=0.3.10-3=1.0.0-2=1.0.0-3=1.0.1-1=1.0.1-3=1.0.1-3ubuntu0.1=1.0.1-3ubuntu0.1+esm1
Ubuntu:Pro:18.04:LTSmore threats →ghsa
php-phpseclib
pkg:deb/ubuntu/php-phpseclib?arch=source&distro=esm-apps/bionic
Affected versions
<2.0.9-1ubuntu0.1~esm3=2.0.6-1=2.0.7-1=2.0.9-1=2.0.9-1ubuntu0.1~esm2
Ubuntu:Pro:18.04:LTSmore threats →ghsa
phpseclib
pkg:deb/ubuntu/phpseclib?arch=source&distro=esm-apps/bionic
Affected versions
=1.0.7-1=1.0.8-1=1.0.9-1=1.0.9-1ubuntu0.1~esm1=1.0.9-1ubuntu0.1~esm2
Ubuntu:Pro:20.04:LTSmore threats →ghsa
php-phpseclib
pkg:deb/ubuntu/php-phpseclib?arch=source&distro=esm-apps/focal
Affected versions
<2.0.23-2ubuntu0.1~esm3=2.0.21-2=2.0.23-2=2.0.23-2ubuntu0.1~esm2
Ubuntu:Pro:20.04:LTSmore threats →ghsa
phpseclib
pkg:deb/ubuntu/phpseclib?arch=source&distro=esm-apps/focal
Affected versions
=1.0.16-2=1.0.18-2=1.0.18-2ubuntu0.1~esm1=1.0.18-2ubuntu0.1~esm2
Ubuntu:Pro:22.04:LTSmore threats →ghsa
php-phpseclib
pkg:deb/ubuntu/php-phpseclib?arch=source&distro=esm-apps/jammy
Affected versions
<2.0.36-1ubuntu0.1~esm3=2.0.30-2ubuntu1=2.0.34-1=2.0.35-1=2.0.36-1=2.0.36-1ubuntu0.1~esm2
Ubuntu:Pro:22.04:LTSmore threats →ghsa
php-phpseclib3
pkg:deb/ubuntu/php-phpseclib3?arch=source&distro=esm-apps/jammy
Affected versions
=3.0.9-1=3.0.10-1=3.0.12-2=3.0.13-1=3.0.13-1ubuntu0.1~esm1
Ubuntu:Pro:22.04:LTSmore threats →ghsa
phpseclib
pkg:deb/ubuntu/phpseclib?arch=source&distro=esm-apps/jammy
Affected versions
=1.0.19-3ubuntu2=1.0.19-3ubuntu3=1.0.20-1=1.0.20-1ubuntu0.1~esm1
Ubuntu:24.04:LTSmore threats →ghsa
php-phpseclib3
pkg:deb/ubuntu/php-phpseclib3?arch=source&distro=noble
Affected versions
=3.0.21-2=3.0.33-1=3.0.34-1=3.0.35-1=3.0.37-1
Ubuntu:Pro:24.04:LTSmore threats →ghsa
php-phpseclib
pkg:deb/ubuntu/php-phpseclib?arch=source&distro=esm-apps/noble
Affected versions
<2.0.47-1ubuntu0.1~esm1=2.0.44-1=2.0.45-1=2.0.46-1=2.0.47-1
Ubuntu:Pro:24.04:LTSmore threats →ghsa
phpseclib
pkg:deb/ubuntu/phpseclib?arch=source&distro=esm-apps/noble
Affected versions
=1.0.21-2=1.0.22-1=1.0.23-1=1.0.23-1ubuntu0.1~esm1
Ubuntu:25.10more threats →ghsa
php-phpseclib
pkg:deb/ubuntu/php-phpseclib?arch=source&distro=questing
Affected versions
=2.0.48-3
Ubuntu:25.10more threats →ghsa
php-phpseclib3
pkg:deb/ubuntu/php-phpseclib3?arch=source&distro=questing
Affected versions
=3.0.43-2
Ubuntu:25.10more threats →ghsa
phpseclib
pkg:deb/ubuntu/phpseclib?arch=source&distro=questing
Affected versions
=1.0.23-6
Ubuntu:26.04:LTSmore threats →ghsa
php-phpseclib3
pkg:deb/ubuntu/php-phpseclib3?arch=source&distro=resolute
Affected versions
=3.0.43-2=3.0.44-1=3.0.47-1=3.0.49-1=3.0.49-1ubuntu1
Ubuntu:Pro:26.04:LTSmore threats →ghsa
php-phpseclib
pkg:deb/ubuntu/php-phpseclib?arch=source&distro=esm-apps/resolute
Affected versions
<2.0.51-1ubuntu0.1~esm1=2.0.48-3=2.0.49-1=2.0.51-1
Ubuntu:Pro:26.04:LTSmore threats →ghsa
phpseclib
pkg:deb/ubuntu/phpseclib?arch=source&distro=esm-apps/resolute
Affected versions
=1.0.23-6=1.0.24-1=1.0.24-1ubuntu0.1~esm1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

Technical Details

Gcve Source
db.gcve.eu
Osv Id
UBUNTU-CVE-2026-40194
Osv Schema Version
1.7.0
Ecosystems
["Ubuntu:Pro:16.04:LTS","Ubuntu:Pro:18.04:LTS","Ubuntu:Pro:20.04:LTS","Ubuntu:Pro:22.04:LTS","Ubuntu:24.04:LTS","Ubuntu:Pro:24.04:LTS","Ubuntu:25.10","Ubuntu:26.04:LTS","Ubuntu:Pro:26.04:LTS"]
Cvss Version
3.1

Threat ID: 6abb4194f7a7c54106cc380e

Added to database: 09/29/2026, 04:41:56 UTC

Last updated: 09/29/2026, 04:41:56 UTC

Views: 1

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses