Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. net-imap
  4. ›
  5. CVE-2025-25186

CVE-2025-25186: Possible DoS by memory exhaustion in net-imap

February 10, 2025 (updated April 30, 2025)

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.

References

  • github.com/advisories/GHSA-7fc5-f82f-cx69
  • github.com/ruby/net-imap
  • github.com/ruby/net-imap/commit/70e3ddd071a94e450b3238570af482c296380b35
  • github.com/ruby/net-imap/commit/c8c5a643739d2669f0c9a6bb9770d0c045fd74a3
  • github.com/ruby/net-imap/commit/cb92191b1ddce2d978d01b56a0883b6ecf0b1022
  • github.com/ruby/net-imap/security/advisories/GHSA-7fc5-f82f-cx69
  • github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2025-25186.yml
  • nvd.nist.gov/vuln/detail/CVE-2025-25186
  • ruby.github.io/net-imap/Net/IMAP/AppendUIDData.html
  • ruby.github.io/net-imap/Net/IMAP/CopyUIDData.html
  • ruby.github.io/net-imap/Net/IMAP/UIDPlusData.html

Code Behaviors & Features

Detect and mitigate CVE-2025-25186 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.3.2 before 0.3.8, all versions starting from 0.4.0 before 0.4.19, all versions starting from 0.5.0 before 0.5.6

Fixed versions

  • 0.3.8
  • 0.4.19
  • 0.5.6

Solution

Upgrade to versions 0.3.8, 0.4.19, 0.5.6 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-1287: Improper Validation of Specified Type of Input
  • CWE-400: Uncontrolled Resource Consumption
  • CWE-405: Asymmetric Resource Consumption (Amplification)
  • CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
  • CWE-770: Allocation of Resources Without Limits or Throttling
  • CWE-789: Memory Allocation with Excessive Size Value

Source file

gem/net-imap/CVE-2025-25186.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:18 +0000.