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
    • 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-25186

CVE-2025-25186: Net::IMAP Ruby DoS Vulnerability

CVE-2025-25186 is a denial of service vulnerability in Net::IMAP for Ruby that allows memory exhaustion through compressed uid-set data. This article covers technical details, affected versions, impact, and mitigation.

Updated: January 22, 2026

CVE-2025-25186 Overview

CVE-2025-25186 is a Memory Exhaustion Denial of Service vulnerability in the Net::IMAP library, which provides Internet Message Access Protocol (IMAP) client functionality in Ruby. The vulnerability exists in the response parser's handling of uid-set data, where a malicious IMAP server can send highly compressed uid-set ranges that are automatically expanded into memory-consuming arrays.

Starting in version 0.3.2, the response parser uses Range#to_a to convert uid-set data into arrays of integers without any limitation on the expanded size of the ranges. This allows an attacker controlling a malicious IMAP server to craft responses containing compressed uid-set data that expands to enormous arrays, exhausting available memory on the client system.

Critical Impact

A malicious IMAP server can cause denial of service through memory exhaustion on any Ruby application using vulnerable versions of Net::IMAP by sending specially crafted uid-set responses.

Affected Products

  • Net::IMAP versions 0.3.2 through 0.3.7
  • Net::IMAP versions 0.4.0 through 0.4.18
  • Net::IMAP versions 0.5.0 through 0.5.5

Discovery Timeline

  • 2025-02-10 - CVE-2025-25186 published to NVD
  • 2025-02-10 - Last updated in NVD database

Technical Details for CVE-2025-25186

Vulnerability Analysis

This vulnerability (CWE-400: Uncontrolled Resource Consumption) affects the Net::IMAP response parser in Ruby applications. The attack occurs when a connected IMAP client receives responses from a malicious server containing specially crafted uid-set data.

The vulnerability specifically targets the DeprecatedUIDPlus function in the response parser, which processes COPYUID and APPENDUID response codes. When parsing uid-set data, the original code would call .each_ordered_number.to_a on the uid-set ranges, converting them directly into arrays without bounds checking. A range like 1:4294967295 (representing all possible UIDs) would be expanded into an array containing billions of integers, quickly exhausting system memory.

The attack is particularly dangerous because the client's receiver thread automatically reads and processes server responses. An attacker doesn't need to wait for specific client actions—they simply need the client to connect to their malicious server, then send the crafted response at any time during the connection.

Root Cause

The root cause is the lack of size validation when converting compressed uid-set range data into expanded integer arrays. The original implementation trusted server-provided uid-set ranges to be reasonable in size, calling Range#to_a on arbitrary ranges without checking the potential expanded size. This violates the security principle of never trusting external input, especially from network sources.

The vulnerable code pattern was:

ruby
src_uids &&= src_uids.each_ordered_number.to_a
dst_uids   = dst_uids.each_ordered_number.to_a

This allowed unbounded expansion of compact range representations into memory-consuming arrays.

Attack Vector

The attack requires a victim application to connect to a malicious IMAP server controlled by the attacker. The attack vector is network-based and requires user interaction (the user must initiate or configure a connection to the malicious server). Once connected, the malicious server can send crafted responses at any time to trigger memory exhaustion.

The patched code introduces MAX_UID_SET_SIZE and bounds checking:

ruby
# Security patch in lib/net/imap/response_parser.rb
# Source: https://github.com/ruby/net-imap/commit/cb92191b1ddce2d978d01b56a0883b6ecf0b1022

class ResponseParser
  MAX_UID_SET_SIZE = 10_000

  def initialize
    @str = nil

The fix in the DeprecatedUIDPlus function validates sizes before expansion:

ruby
# Security patch in lib/net/imap/response_parser.rb
# Source: https://github.com/ruby/net-imap/commit/70e3ddd071a94e450b3238570af482c296380b35

# TODO: remove this code in the v0.6.0 release
def DeprecatedUIDPlus(validity, src_uids = nil, dst_uids)
  return unless config.parser_use_deprecated_uidplus_data
  compact_uid_sets = [src_uids, dst_uids].compact
  count = compact_uid_sets.map { _1.count_with_duplicates }.max
  max   = config.parser_max_deprecated_uidplus_data_size
  if count <= max
    src_uids &&= src_uids.each_ordered_number.to_a
    dst_uids   = dst_uids.each_ordered_number.to_a
    UIDPlusData.new(validity, src_uids, dst_uids)
  elsif config.parser_use_deprecated_uidplus_data != :up_to_max_size
    parse_error("uid-set is too large: %d > %d", count, max)
  end
end

Detection Methods for CVE-2025-25186

Indicators of Compromise

  • Unusual memory consumption spikes in Ruby applications using Net::IMAP
  • Application crashes or out-of-memory (OOM) errors during IMAP operations
  • IMAP connections to unknown or untrusted mail servers
  • Log entries showing abnormally large uid-set ranges in IMAP responses

Detection Strategies

  • Monitor memory usage patterns of Ruby applications that implement IMAP client functionality
  • Implement application-level logging for IMAP response sizes and uid-set ranges
  • Use dependency scanning tools to identify vulnerable Net::IMAP versions in your codebase
  • Configure memory limits and resource constraints for Ruby processes handling IMAP connections

Monitoring Recommendations

  • Set up alerts for abnormal memory growth in IMAP-enabled Ruby applications
  • Monitor for OOM killer events on systems running vulnerable applications
  • Track outbound connections from applications to untrusted IMAP servers
  • Review application logs for parser errors or unexpected disconnections during IMAP operations

How to Mitigate CVE-2025-25186

Immediate Actions Required

  • Update Net::IMAP to patched versions: 0.3.8, 0.4.19, 0.5.6, or higher
  • Review your Ruby application dependencies using bundle audit or similar tools
  • Set parser_use_deprecated_uidplus_data to false in Net::IMAP configuration to completely block the vulnerability
  • Ensure applications only connect to trusted IMAP servers

Patch Information

Security patches have been released in Net::IMAP versions 0.3.8, 0.4.19, and 0.5.6. The patches introduce a configurable maximum size limit (parser_max_deprecated_uidplus_data_size) for uid-set expansion, with a default value of 10_000 entries. Additional configuration options provide backward compatibility while allowing security-conscious deployments to completely disable the vulnerable code path.

For detailed configuration guidance and backward compatibility information, refer to the GitHub Security Advisory GHSA-7fc5-f82f-cx69.

Relevant commits:

  • GitHub Commit 70e3ddd
  • GitHub Commit c8c5a64
  • GitHub Commit cb92191

Workarounds

  • Disable deprecated UIDPlus data parsing by setting parser_use_deprecated_uidplus_data to false
  • Configure parser_max_deprecated_uidplus_data_size to a low value appropriate for your use case
  • Implement memory limits on Ruby processes using container orchestration or system-level controls
  • Only connect to known and trusted IMAP servers
ruby
# Configuration example for Net::IMAP
# Disable vulnerable deprecated UIDPlus parsing entirely
Net::IMAP.config.parser_use_deprecated_uidplus_data = false

# Or limit the maximum size of uid-set expansion
Net::IMAP.config.parser_max_deprecated_uidplus_data_size = 1000

# Use :up_to_max_size to silently truncate instead of raising errors
Net::IMAP.config.parser_use_deprecated_uidplus_data = :up_to_max_size

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

  • EPSS Probability0.25%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-400
  • Technical References
  • GitHub Commit 70e3ddd

  • GitHub Commit c8c5a64

  • GitHub Commit cb92191

  • GitHub Security Advisory GHSA-7fc5-f82f-cx69
  • Related CVEs
  • CVE-2023-36617: Ruby-lang URI DoS Vulnerability

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

  • CVE-2023-28756: Ruby-lang Ruby ReDoS Vulnerability

  • CVE-2025-27220: Ruby-lang CGI ReDoS 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