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-42245

CVE-2026-42245: Ruby Net::IMAP DoS Vulnerability

CVE-2026-42245 is a denial of service vulnerability in Ruby's Net::IMAP library caused by quadratic time complexity in response parsing. This article covers the technical details, affected versions, and mitigation.

Published: May 18, 2026

CVE-2026-42245 Overview

CVE-2026-42245 is a denial-of-service vulnerability in the Ruby Net::IMAP library, which implements Internet Message Access Protocol (IMAP) client functionality. The flaw resides in Net::IMAP::ResponseReader, which exhibits quadratic time complexity when parsing large server responses containing many string literals. A hostile IMAP server can return crafted responses that force the client to exhaust CPU resources. The issue is patched in versions 0.4.24, 0.5.14, and 0.6.4. The vulnerability is classified under [CWE-407] (Inefficient Algorithmic Complexity).

Critical Impact

A malicious IMAP server can deliver responses that drive a connected Ruby client into prolonged CPU saturation, causing denial of service on the client process.

Affected Products

  • Ruby net-imap gem versions prior to 0.4.24 (0.4.x branch)
  • Ruby net-imap gem versions prior to 0.5.14 (0.5.x branch)
  • Ruby net-imap gem versions prior to 0.6.4 (0.6.x branch)

Discovery Timeline

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

Technical Details for CVE-2026-42245

Vulnerability Analysis

The vulnerability is an algorithmic complexity flaw in the response parser. Net::IMAP::ResponseReader accumulates data into an internal buffer (@buff) while iteratively reading lines and embedded string literals. When the server response contains many string literals, the read loop performs work that scales quadratically with input size rather than linearly. An attacker controlling the IMAP server can therefore force the Ruby client to consume CPU disproportionate to bandwidth used, resulting in client-side denial of service. The CVSS 4.0 vector indicates that only availability of the vulnerable component is impacted, with no effect on confidentiality or integrity.

Root Cause

The read_response_buffer method in lib/net/imap/response_reader.rb did not enforce a maximum response size, and its handling of literal-size bookkeeping caused repeated work across iterations. Without a guard on cumulative response size, large multi-literal responses are processed with non-linear performance characteristics.

Attack Vector

Exploitation requires a Ruby application to connect to an attacker-controlled or compromised IMAP server. Once connected, the server returns a crafted response containing many string literals, and the client's ResponseReader enters a CPU-bound parsing path. No authentication on the client side is required for the server to deliver the malicious response.

ruby
# Patch excerpt from lib/net/imap/response_reader.rb
# Source: https://github.com/ruby/net-imap/commit/de685f91a4a4cc75eb80da898c2bf8af08d34819

      def initialize(client, sock)
        @client, @sock = client, sock
        # cached config
        @max_response_size = nil
        # response buffer state
        @buff = @literal_size = nil
      end

      def read_response_buffer
        @max_response_size = client.max_response_size
        @buff = String.new
        catch :eof do
          while true
            guard_response_too_large!
            read_line
            # check before allocating memory for literal
            guard_response_too_large!
            break unless literal_size
            read_literal
          end
        end
        buff
      ensure
        @buff = @literal_size = nil
      end

The fix introduces guard_response_too_large! checks before reading a line and before allocating memory for a literal, and caches max_response_size from the client configuration. Backport commits 6091f7d6 (0.5.x) and 88d95231 (0.4.x) apply equivalent state-tracking changes.

Detection Methods for CVE-2026-42245

Indicators of Compromise

  • Ruby processes using the net-imap gem exhibiting sustained 100% CPU usage shortly after establishing an IMAP session.
  • Long-running or hung IMAP client threads with stack frames inside Net::IMAP::ResponseReader#read_response_buffer.
  • Outbound IMAP connections to untrusted or unexpected mail servers from application hosts.

Detection Strategies

  • Inventory Ruby applications and Bundler lockfiles to identify uses of net-imap at versions below 0.4.24, 0.5.14, or 0.6.4.
  • Instrument IMAP client code paths with timing telemetry to detect responses that take disproportionately long to parse relative to byte count.
  • Correlate process CPU spikes with active TCP sessions on port 143/993 to identify suspect IMAP peers.

Monitoring Recommendations

  • Alert on Ruby worker processes exceeding CPU thresholds while holding an open IMAP socket.
  • Log and review IMAP server endpoints configured in application settings, flagging unexpected destinations.
  • Track gem dependency drift in CI pipelines and fail builds that pin vulnerable net-imap versions.

How to Mitigate CVE-2026-42245

Immediate Actions Required

  • Upgrade the net-imap gem to 0.4.24, 0.5.14, or 0.6.4 depending on the branch currently in use.
  • Restrict outbound IMAP connections from application servers to known, trusted mail providers.
  • Set a conservative max_response_size on Net::IMAP clients so that the new guard rejects oversized server responses.

Patch Information

The issue is fixed in net-imap0.4.24, 0.5.14, and 0.6.4. See the GitHub Security Advisory GHSA-q2mw-fvj9-vvcw and the release notes for v0.4.24, v0.5.14, and v0.6.4. The primary fix landed in commit de685f91 with backports in 88d95231 and 6091f7d6.

Workarounds

  • Connect only to trusted IMAP servers under your administrative control.
  • Apply per-request timeouts and CPU/time limits around IMAP client operations so a stalled parse cannot indefinitely consume a worker.
  • Configure max_response_size on the IMAP client to bound buffer growth once on a patched version.
bash
# Update the gem to a patched release
bundle update net-imap

# Verify the installed version is patched
ruby -e "require 'net/imap'; puts Net::IMAP::VERSION"
# Expected output: 0.4.24, 0.5.14, or 0.6.4

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechRuby

  • SeverityLOW

  • CVSS Score2.3

  • EPSS Probability0.08%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:L/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
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-407
  • Technical References
  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Release v0.4.24

  • GitHub Release v0.5.14

  • GitHub Release v0.6.4

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-42256: Ruby Net::IMAP DOS Vulnerability

  • CVE-2023-36617: Ruby-lang URI DoS Vulnerability

  • CVE-2023-28755: Ruby-lang Uri DoS Vulnerability

  • CVE-2023-28756: Ruby-lang Ruby ReDoS 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