The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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-42246

CVE-2026-42246: Ruby Net::IMAP TLS Bypass Vulnerability

CVE-2026-42246 is a TLS bypass flaw in Ruby's Net::IMAP library that allows man-in-the-middle attackers to intercept communications. This article covers the technical details, affected versions, impact, and mitigation.

Published: May 18, 2026

CVE-2026-42246 Overview

CVE-2026-42246 affects the Ruby Net::IMAP library, which implements Internet Message Access Protocol (IMAP) client functionality. A man-in-the-middle (MITM) attacker can manipulate the IMAP server response so that Net::IMAP#starttls returns successfully without actually negotiating TLS. The client then continues the session in cleartext while believing the connection is encrypted. This issue is classified under [CWE-392] (Missing Report of Error Condition) and is a classic STARTTLS stripping flaw. Patched releases are 0.3.10, 0.4.24, 0.5.14, and 0.6.4.

Critical Impact

An attacker positioned between the Ruby application and the IMAP server can strip STARTTLS, exposing IMAP credentials and message contents in cleartext.

Affected Products

  • Ruby net-imap gem versions prior to 0.3.10
  • Ruby net-imap gem versions 0.4.0 through 0.4.23
  • Ruby net-imap gem versions 0.5.0 through 0.5.13 and 0.6.0 through 0.6.3

Discovery Timeline

  • 2026-05-09 - CVE-2026-42246 published to NVD
  • 2026-05-13 - Last updated in NVD database

Technical Details for CVE-2026-42246

Vulnerability Analysis

The Net::IMAP#starttls method issued a STARTTLS command and then attempted to upgrade the socket to TLS. The original implementation did not verify that the server actually returned a tagged OK response before treating the upgrade as successful. If a network attacker injected an untagged response or otherwise manipulated the reply, the method could return without raising an error and without calling start_tls_session. The client continued issuing IMAP commands, including LOGIN, over the plaintext TCP socket.

Root Cause

The root cause is missing error reporting around the STARTTLS handshake. The method assumed any non-exceptional return from send_command implied successful TLS negotiation. There was no explicit handled state tracking confirming that the server delivered a tagged OK response and that start_tls_session actually executed. This is the condition described by [CWE-392].

Attack Vector

An attacker with a network position between the Ruby application and the IMAP server intercepts traffic on the IMAP port. The attacker forwards the client's STARTTLS request but responds with a crafted reply that does not contain a tagged OK, or forces an error path that fails to raise. The client treats the TLS upgrade as complete and proceeds to send credentials and mailbox commands in plaintext, which the attacker captures.

ruby
# Patch from ruby/net-imap commit 0ede4c40b1523dfeaf95777b2678e54cc0fd9618
# Adds explicit `handled` tracking to verify the server returned a tagged OK
# before considering STARTTLS successful.
def starttls(**options)
  @ssl_ctx_params, @ssl_ctx = build_ssl_ctx(options)
  handled = false
  error = nil
  ok = send_command("STARTTLS") do |resp|
    if resp.kind_of?(TaggedResponse) && resp.name == "OK"
      handled = true
      clear_cached_capabilities
      clear_responses
      start_tls_session
    end
  end
end
# Source: https://github.com/ruby/net-imap/commit/0ede4c40b1523dfeaf95777b2678e54cc0fd9618

Detection Methods for CVE-2026-42246

Indicators of Compromise

  • IMAP sessions originating from Ruby applications that contain LOGIN commands or message data transmitted over plaintext TCP on port 143 after a STARTTLS exchange.
  • Network captures where the IMAP server response to STARTTLS is missing a tagged OK line but the client continues issuing commands.
  • Outbound IMAP connections from application servers to unexpected hosts or proxies on port 143.

Detection Strategies

  • Inventory Ruby application dependencies and flag any net-imap gem version below 0.3.10, 0.4.24, 0.5.14, or 0.6.4.
  • Inspect IMAP traffic at egress points to confirm that sessions transition to TLS immediately after STARTTLS and do not continue in cleartext.
  • Run software composition analysis against Gemfile.lock artifacts in CI to detect vulnerable net-imap versions before deployment.

Monitoring Recommendations

  • Alert on plaintext IMAP authentication attempts observed on the network, particularly from server workloads.
  • Monitor for new or unauthorized hosts proxying IMAP traffic between application servers and mail providers.
  • Log Ruby application gem versions during deployment and feed inventory data into vulnerability management workflows.

How to Mitigate CVE-2026-42246

Immediate Actions Required

  • Upgrade the net-imap gem to 0.3.10, 0.4.24, 0.5.14, or 0.6.4 depending on the major version line in use.
  • Rebuild and redeploy any Ruby applications, including Rails services, that bundle a vulnerable net-imap gem.
  • Rotate any IMAP credentials used by Ruby applications that connected over networks where MITM interception was possible.

Patch Information

Fixes are available in the GitHub Security Advisory GHSA-vcgp-9326-pqcp. The patched releases are v0.3.10, v0.4.24, and v0.5.14, plus 0.6.4. The core fix is implemented in commit 0ede4c40, with backports in commit 24a4e770 and commit 97e2488f.

Workarounds

  • Connect to IMAP servers using implicit TLS on port 993 (Net::IMAP.new(host, ssl: true)) instead of relying on STARTTLS upgrade on port 143.
  • Restrict outbound IMAP traffic from application servers to known mail server endpoints to reduce MITM exposure.
  • Pin net-imap to a patched version in Gemfile and run bundle update net-imap followed by verification with bundle list.
bash
# Update the net-imap gem to a patched release
bundle update net-imap

# Verify the installed version is patched
bundle list | grep net-imap
# Expected output: net-imap (0.3.10) or 0.4.24 or 0.5.14 or 0.6.4 or higher

# Prefer implicit TLS on port 993 in Ruby code
# imap = Net::IMAP.new('imap.example.com', port: 993, ssl: true)

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

  • Vulnerability Details
  • TypeOther

  • Vendor/TechRuby

  • SeverityHIGH

  • CVSS Score7.6

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-392
  • Technical References
  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Release v0.3.10

  • GitHub Release v0.4.24

  • GitHub Release v0.5.14

  • GitHub Security Advisory GHSA-vcgp-9326-pqcp
  • Related CVEs
  • CVE-2026-42258: Ruby Net::IMAP Command Injection Flaw

  • CVE-2020-25613: Ruby WEBrick HTTP Request Smuggling Flaw

  • CVE-2020-10663: Ruby JSON Gem Object Creation Vulnerability

  • CVE-2026-42245: Ruby Net::IMAP DoS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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