Read the docs
TI-2026-29008 Aliases CVE-2026-40194GHSA-r854-jrxh-36qx

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

Priority MEDIUM 51CWE-208Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
High
Impact type
Information disclosure
Confidentiality · integrity · availability
Low · None · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-208.

Summary

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00368 30th percentileScored 2026-11-07
Fix Fixed phpseclib (phpseclib): 1.0.28, 2.0.53, 3.0.51phpseclib/phpseclib (Packagist): 1.0.28, 2.0.53, 3.0.51

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
phpseclibphpseclib0.1.1 to before 1.0.28; 2.0.0 to before 2.0.53; 3.0.0 to before 3.0.511.0.28, 2.0.53, 3.0.51Patch availableCNA
—phpseclib/phpseclib (Packagist)0.1.1 to before 1.0.281.0.28Patch availableGHSA-r854-jrxh-36qx
—phpseclib/phpseclib (Packagist)2.0.0 to before 2.0.532.0.53Patch availableGHSA-r854-jrxh-36qx
—phpseclib/phpseclib (Packagist)3.0.0 to before 3.0.513.0.51Patch availableGHSA-r854-jrxh-36qx
  • phpseclib Vendorphpseclib Affected 0.1.1 to before 1.0.28; 2.0.0 to before 2.0.53; 3.0.0 to before 3.0.51 Fixed in 1.0.28, 2.0.53, 3.0.51 Patch available CNA
  • phpseclib/phpseclib (Packagist) Vendor— Affected 0.1.1 to before 1.0.28 Fixed in 1.0.28 Patch available GHSA-r854-jrxh-36qx
  • phpseclib/phpseclib (Packagist) Vendor— Affected 2.0.0 to before 2.0.53 Fixed in 2.0.53 Patch available GHSA-r854-jrxh-36qx
  • phpseclib/phpseclib (Packagist) Vendor— Affected 3.0.0 to before 3.0.51 Fixed in 3.0.51 Patch available GHSA-r854-jrxh-36qx

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:*up to 1.0.27; 2.0.0 to before 2.0.53; 3.0.0 to before 3.0.51Vulnerablephpseclib
  • cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:* Versions up to 1.0.27; 2.0.0 to before 2.0.53; 3.0.0 to before 3.0.51 Vulnerable ·phpseclib

Remediation

  • Fix · CNA phpseclib (phpseclib) Fixed in 1.0.28, 2.0.53, 3.0.51
  • Fix · GHSA-r854-jrxh-36qx phpseclib/phpseclib (Packagist) Fixed in 1.0.28 Advisory →
  • Fix · GHSA-r854-jrxh-36qx phpseclib/phpseclib (Packagist) Fixed in 2.0.53 Advisory →
  • Fix · GHSA-r854-jrxh-36qx phpseclib/phpseclib (Packagist) Fixed in 3.0.51 Advisory →

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-40194
  2. 2026-10-03 Alias added: GHSA-r854-jrxh-36qx

References

  • TI-2026-40135 Server-side request forgery in phpseclib CVSS 3.1MEDIUM 5.8
  • TI-2023-29213 In phpseclib before 1.0.22, 2.x before 2.0.46, and 3.x before 3.0.33, some characters in… CVSS 3.1HIGH 7.5
  • TI-2024-18192 An issue was discovered in phpseclib 1.x before 1.0.23, 2.x before 2.0.47, and 3.x before… CVSS 3.1HIGH 7.5
  • TI-2024-18191 An issue was discovered in phpseclib 1.x before 1.0.23, 2.x before 2.0.47, and 3.x before… CVSS 3.1HIGH 7.5
  • TI-2023-12272 Math/PrimeField.php in phpseclib 3.x before 3.0.19 has an infinite loop with composite primefields. CVSS 3.1HIGH 7.5
  • TI-2026-25383 phpseclib's AES-CBC unpadding susceptible to padding oracle timing attack CVSS 4.0HIGH 8.2
See all 8 →

Sources