Skip to main content

Phpseclib CVE-2026-40194

| EUVDEUVD-2026-21597 LOW
Observable Timing Discrepancy (CWE-208)
2026-04-10 GitHub_M GHSA-r854-jrxh-36qx
3.7
CVSS 3.1 · GitHub Advisory
View

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V6 - Authentication Timing attack prevention
Impact

CVSS 3.7 reflects low overall severity: attack requires network access (AV:N), but high complexity (AC:H) due to timing precision requirements, no privilege escalation (PR:N, UI:N), and only low confidentiality impact (C:L). However, CVSS underweights cryptographic timing attacks. EPSS data is not provided, but real-world exploitability is constrained by practical factors: attackers must achieve sub-millisecond timing precision over the network, which is difficult in high-latency or noisy network environments. The attack does not achieve authentication bypass or remote code execution-only gradual disclosure of session HMAC values, which does not directly compromise plaintext if the SSH symmetric ciphers remain unbroken. The lack of confirmed public exploit code (POC=NO) and no CISA KEV listing indicate limited active exploitation risk at present. However, the vulnerability is definitively real: the GitHub commit and academic literature on timing attacks validate the threat. For organizations using phpseclib in performance-critical SSH scenarios with untrusted network positions, patching is justified; for typical LAN or VPN-protected deployments, risk is minimal.

Exploit ScenarioDerived

An attacker on a network path between a PHP application using phpseclib and an SSH server (or controlling the SSH server) can measure SSH packet response times to the application. By crafting SSH packets with incrementally modified HMAC values and observing which variants produce longer response times, the attacker can deduce the correct HMAC one byte at a time. After inferring the session HMAC, the attacker gains information about the symmetric session key derivation but cannot directly decrypt past traffic without breaking the underlying cipher. The attack requires high-precision timing (microsecond-level), favoring local or LAN attackers or those with sophisticated network measurement tools; internet-scale attacks are impractical. No public exploit code is available, limiting risk from unsophisticated threat actors.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 10, 2026

phpseclib's SSH2 packet authentication uses PHP's non-constant-time != operator to compare HMACs, enabling timing-based information disclosure attacks on SSH sessions. The vulnerability affects phpseclib versions prior to 1.0.28, 2.0.53, and 3.0.51. An unauthenticated remote attacker can exploit variable-time comparison behavior to infer valid HMAC values through precise timing measurements, potentially compromising the confidentiality of SSH communications. No public exploit code or active exploitation has been confirmed, but this is a cryptographic timing vulnerability with proven scalability via benchmarking.

RemediationAI

Vendor-released patches are available: upgrade to phpseclib 1.0.28 or later, 2.0.53 or later, or 3.0.51 or later, depending on the current major version in use. Apply the patch immediately if phpseclib is used in SSH connections across untrusted networks or where attackers may control network latency measurements. Workarounds are not practical for this cryptographic issue; patching is required. Refer to the official security advisory at https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx and verify the patched release via https://github.com/phpseclib/phpseclib/releases (tags 1.0.28, 2.0.53, and 3.0.51). The underlying fix (commit ffe48b6b1b1af6963327f0a5330e3aa004a194ac) replaces the != operator with hash_equals(), a constant-time comparison function.

Affected VersionsENISA

phpseclib 2.0.0, < 2.0.53
phpseclib 3.0.0, < 3.0.51
phpseclib < 1.0.28

Affected Packages

composer phpseclib/phpseclib fix: 1.0.28, 2.0.53, 3.0.51
euvd phpseclib fix: 1.0.28, 2.0.53, 3.0.51

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

phpseclib implements SSH protocol functionality via the Net\SSH2 class, which validates packet integrity using HMAC-based authentication codes. The vulnerability resides in the get_binary_packet() method, which employs PHP's != operator for HMAC comparison. In PHP, the != operator on binary strings of equal length internally uses the C memcmp() function, which performs byte-by-byte comparison and exits immediately upon finding the first differing byte. This short-circuit behavior creates a measurable timing side-channel (CWE-208: Observable Timing Discrepancy): valid HMACs require memcmp() to compare all bytes before returning false, while invalid HMACs with differing early bytes return faster. By measuring response latency across many SSH packets with systematically varied HMACs, an attacker can narrow the valid HMAC byte-by-byte, reducing computational complexity from 2^(HMAC_length) to roughly 256 * HMAC_length attempts. The affected CPE (cpe:2.3:a:phpseclib:phpseclib) spans all installations prior to the patched releases.

Know when Phpseclib gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 3.7 LOW
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch released
Apr 11, 2026 - 02:30 nvd
Patch available
CVE Published
Apr 10, 2026 - 20:24 nvd
LOW 3.7

DescriptionGitHub Advisory

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

Threat Intelligence Overview

EPSS Score
0.0%
Top 99% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

18
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +18
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy