Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40194

CVE-2026-40194: phpseclib Information Disclosure Flaw

CVE-2026-40194 is an information disclosure vulnerability in phpseclib caused by a timing attack in HMAC comparison. This article covers the technical details, affected versions, security impact, and mitigation.

Published: April 17, 2026

CVE-2026-40194 Overview

CVE-2026-40194 is a timing attack vulnerability (CWE-208) affecting phpseclib, a widely-used PHP secure communications library. The vulnerability exists in the phpseclib\Net\SSH2::get_binary_packet() function, which uses PHP's != operator to compare a received SSH packet HMAC against the locally computed HMAC. This non-constant-time comparison operation allows attackers to potentially extract HMAC values through timing side-channel analysis.

Critical Impact

Attackers positioned on the network may leverage timing analysis to gain partial information about HMAC values, potentially undermining the integrity verification of SSH communications.

Affected Products

  • phpseclib versions prior to 3.0.51
  • phpseclib versions prior to 2.0.53
  • phpseclib versions prior to 1.0.28

Discovery Timeline

  • 2026-04-10 - CVE CVE-2026-40194 published to NVD
  • 2026-04-13 - Last updated in NVD database

Technical Details for CVE-2026-40194

Vulnerability Analysis

The vulnerability stems from the use of PHP's != comparison operator in the SSH2 packet handling code. When comparing equal-length binary strings, PHP's != operator internally uses memcmp(), which performs a byte-by-byte comparison that short-circuits on the first differing byte. This behavior creates a measurable timing difference based on how many leading bytes match between the received HMAC and the expected HMAC.

This timing side-channel attack (CWE-208) allows an attacker who can observe network timing to statistically deduce information about the correct HMAC value. While exploitation requires precise timing measurements and statistical analysis over many connection attempts, the vulnerability has been proven through scaling benchmarks to demonstrate real variable-time behavior.

Root Cause

The root cause is the use of a non-constant-time string comparison operation for cryptographic verification. The != operator in PHP does not provide constant-time guarantees when comparing strings, as the underlying memcmp() function returns immediately upon finding a differing byte. Cryptographic comparisons should always use constant-time algorithms that take the same amount of time regardless of how many bytes match.

Attack Vector

The attack vector is network-based. An attacker must be able to:

  1. Intercept or observe SSH connections to systems using vulnerable phpseclib versions
  2. Measure the precise timing of HMAC verification responses
  3. Perform statistical analysis across many SSH packet exchanges to detect timing variations
  4. Reconstruct partial or complete HMAC values through accumulated timing data

While the attack complexity is high and requires sophisticated timing analysis capabilities, it represents a real cryptographic weakness that violates security best practices for HMAC verification.

php
// Security patch in phpseclib/Net/SSH2.php - SSH2: use constant time string comparison in get_binary_packet()
                $this->bitmap = 0;
                user_error('Error reading socket');
                return false;
-            } elseif ($hmac != $this->hmac_check->hash(pack('NNCa*', $this->get_seq_no, $packet_length, $padding_length, $payload . $padding))) {
+            } elseif (!$this->_equals($hmac, $this->hmac_check->hash(pack('NNCa*', $this->get_seq_no, $packet_length, $padding_length, $payload . $padding)))) {
                user_error('Invalid HMAC');
                return false;
            }

Source: GitHub Commit Update

Detection Methods for CVE-2026-40194

Indicators of Compromise

  • Unusual patterns of repeated SSH connection attempts from the same source with minimal data exchange
  • High-frequency connection requests with precise timing characteristics indicative of timing analysis
  • Network traffic patterns suggesting statistical probing of SSH endpoints

Detection Strategies

  • Implement dependency scanning to identify phpseclib installations running vulnerable versions (prior to 3.0.51, 2.0.53, or 1.0.28)
  • Deploy Software Composition Analysis (SCA) tools to audit PHP projects for vulnerable phpseclib dependencies
  • Review application logs for anomalous SSH connection patterns that may indicate timing attack attempts

Monitoring Recommendations

  • Monitor network traffic for unusual timing patterns in SSH packet exchanges
  • Implement rate limiting on SSH connections to mitigate timing analysis attempts
  • Use intrusion detection systems capable of identifying statistical probing behavior

How to Mitigate CVE-2026-40194

Immediate Actions Required

  • Upgrade phpseclib to version 3.0.51, 2.0.53, or 1.0.28 depending on your version branch
  • Review all applications that depend on phpseclib and update composer dependencies accordingly
  • Audit your codebase for any custom implementations of HMAC verification that may have similar non-constant-time comparison issues

Patch Information

The phpseclib maintainers have released patched versions across all supported branches. The fix replaces the != operator with a constant-time comparison function (_equals()) that provides cryptographically secure string comparison:

  • phpseclib 3.0.51 - For users on the 3.x branch
  • phpseclib 2.0.53 - For users on the 2.x branch
  • phpseclib 1.0.28 - For users on the legacy 1.x branch

For complete details, see the GitHub Security Advisory GHSA-r854-jrxh-36qx.

Workarounds

  • If immediate patching is not possible, consider adding network-level protections such as rate limiting to reduce the effectiveness of timing analysis
  • Implement additional network segmentation to limit attacker visibility into SSH connection timing
  • Monitor for phpseclib updates and prioritize patching as soon as maintenance windows allow
bash
# Update phpseclib using Composer
composer require phpseclib/phpseclib:^3.0.51

# For 2.x branch users
composer require phpseclib/phpseclib:^2.0.53

# For legacy 1.x branch users
composer require phpseclib/phpseclib:^1.0.28

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechPhpseclib

  • SeverityLOW

  • CVSS Score3.7

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-208
  • Technical References
  • GitHub Commit Update

  • GitHub Release Version 1.0.28

  • GitHub Release Version 2.0.53

  • GitHub Release Version 3.0.51

  • GitHub Security Advisory GHSA-r854-jrxh-36qx
  • Related CVEs
  • CVE-2026-32935: Phpseclib Padding Oracle Vulnerability

  • CVE-2023-27560: Phpseclib DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English