A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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-2025-43857

CVE-2025-43857: Ruby-lang Net IMAP DoS Vulnerability

CVE-2025-43857 is a denial of service vulnerability in Ruby-lang Net IMAP that enables memory exhaustion attacks via malicious server responses. This article covers technical details, affected versions, and mitigation.

Published: May 26, 2026

CVE-2025-43857 Overview

CVE-2025-43857 is a denial-of-service vulnerability in the Ruby net-imap library, which implements Internet Message Access Protocol (IMAP) client functionality. A malicious or compromised IMAP server can send a crafted literal byte count that the client's receiver thread reads automatically. The response reader immediately allocates memory matching the server-supplied size, enabling memory exhaustion of the client process.

The issue affects connections to untrusted, buggy, or compromised IMAP servers, including scenarios where the server hostname is user-supplied. Versions prior to 0.5.7, 0.4.20, 0.3.9, and 0.2.5 are affected.

Critical Impact

A remote IMAP server can exhaust client memory by sending a single oversized literal byte count, terminating Ruby applications that connect to attacker-controlled or compromised mail servers.

Affected Products

  • Ruby net-imap versions prior to 0.5.7 (5.x branch)
  • Ruby net-imap versions prior to 0.4.20, 0.3.9, and 0.2.5 (older maintained branches)
  • Ruby applications that connect to user-supplied or untrusted IMAP server hostnames

Discovery Timeline

  • 2025-04-28 - CVE-2025-43857 published to NVD
  • 2025-11-21 - Last updated in NVD database

Technical Details for CVE-2025-43857

Vulnerability Analysis

The net-imap library parses IMAP server responses on a dedicated receiver thread. IMAP responses can include literal strings prefixed with a byte count in the form {N}, where N indicates the number of bytes to follow. The client honors this count by pre-allocating a buffer sized to N before reading the payload from the socket.

No upper bound is enforced on N. A malicious server can advertise an arbitrarily large literal size, causing the Ruby process to allocate memory until the operating system terminates it or the host becomes unresponsive. The flaw maps to [CWE-400] Uncontrolled Resource Consumption and [CWE-770] Allocation of Resources Without Limits or Throttling.

The vulnerability requires an active IMAP connection to a hostile endpoint. It does not yield code execution or data disclosure, but it can disrupt any service that programmatically connects to IMAP servers, including mail aggregators, webmail backends, and automation scripts that accept user-supplied IMAP hosts.

Root Cause

The response reader trusts the server-supplied literal byte count and allocates the corresponding buffer before validating size against available memory or any configured ceiling. Trusting unauthenticated protocol input for allocation sizing is the core defect.

Attack Vector

The attacker controls or operates the IMAP server the victim connects to. After the TCP connection is established, the server emits a response containing an oversized literal length. The client's receiver thread reads the size, allocates memory, and crashes. Exploitation requires user interaction in the form of initiating an IMAP session, often through an application feature that lets users specify a mail server.

No authentication is required because the malicious response can be sent before or during authentication exchanges over the same connection.

Detection Methods for CVE-2025-43857

Indicators of Compromise

  • Ruby application processes terminated by the OOM killer shortly after initiating IMAP connections
  • Sudden memory spikes in worker processes that perform outbound IMAP traffic on TCP/143 or TCP/993
  • Application logs showing NoMemoryError exceptions originating from Net::IMAP response parsing
  • Outbound IMAP connections to unexpected or low-reputation hostnames supplied by end users

Detection Strategies

  • Inventory Ruby applications and Gemfile.lock entries to identify net-imap versions below 0.5.7, 0.4.20, 0.3.9, or 0.2.5
  • Correlate process crash events with outbound IMAP socket activity to flag suspicious server responses
  • Inspect network telemetry for IMAP responses containing unusually large literal byte counts in the {N} syntax

Monitoring Recommendations

  • Alert on Ruby process memory growth exceeding baselines when IMAP sockets are open
  • Track outbound connections to TCP/143 and TCP/993 destinations, especially toward user-supplied hostnames
  • Monitor application error logs for repeated Net::IMAP allocation failures or thread terminations

How to Mitigate CVE-2025-43857

Immediate Actions Required

  • Upgrade net-imap to 0.5.7, 0.4.20, 0.3.9, or 0.2.5 depending on the supported branch in use
  • Audit applications that accept user-supplied IMAP hostnames and restrict them to allowlisted servers where feasible
  • Enforce TLS (imaps://) connections to trusted providers to reduce exposure to man-in-the-middle response injection

Patch Information

The maintainers patched the issue in net-imap versions 0.5.7, 0.4.20, 0.3.9, and 0.2.5. The fix bounds the size of literal allocations and rejects responses exceeding the configured limit. See the GitHub Security Advisory GHSA-j3g3-5qv5-52mj and the corresponding pull requests #442, #445, #446, and #447.

Workarounds

  • Restrict outbound IMAP connections to a vetted list of trusted mail providers via egress firewall rules
  • Run IMAP-consuming workers under strict memory limits (cgroups, container limits) so a crash does not impact other services
  • Reject user-supplied IMAP hostnames or require administrator approval before allowing new server endpoints
bash
# Update the net-imap gem to a patched release
bundle update net-imap

# Or pin a fixed version in the Gemfile
# gem 'net-imap', '>= 0.5.7'

# Verify the installed version
bundle list | grep net-imap

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechRuby

  • SeverityMEDIUM

  • CVSS Score6.0

  • EPSS Probability0.53%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/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
  • AvailabilityHigh
  • CWE References
  • CWE-400

  • CWE-770
  • Vendor Resources
  • GitHub Pull Request #442

  • GitHub Commit Diff #0ae8576

  • GitHub Pull Request #445

  • GitHub Pull Request #446

  • GitHub Pull Request #447

  • GitHub Security Advisory GHSA-j3g3-5qv5-52mj
  • Related CVEs
  • CVE-2026-42245: Ruby Net::IMAP DoS Vulnerability

  • CVE-2026-42256: Ruby Net::IMAP DOS Vulnerability

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

  • CVE-2023-28755: Ruby-lang Uri 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