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

CVE-2025-43857: net-imap rubygem vulnerable to possible DoS by memory exhaustion

April 28, 2025 (updated April 30, 2025)

There is a possibility for denial of service by memory exhaustion when net-imap reads server responses. At any time while the client is connected, a malicious server can send can send a “literal” byte count, which is automatically read by the client’s receiver thread. The response reader immediately allocates memory for the number of bytes indicated by the server response.

This should not be an issue when securely connecting to trusted IMAP servers that are well-behaved. It can affect insecure connections and buggy, untrusted, or compromised servers (for example, connecting to a user supplied hostname).

References

  • github.com/advisories/GHSA-j3g3-5qv5-52mj
  • github.com/ruby/net-imap
  • github.com/ruby/net-imap/pull/444
  • github.com/ruby/net-imap/pull/444/commits/0ae8576c1a90bcd9573f81bdad4b4b824642d105
  • github.com/ruby/net-imap/pull/445
  • github.com/ruby/net-imap/pull/446
  • github.com/ruby/net-imap/pull/447
  • github.com/ruby/net-imap/security/advisories/GHSA-j3g3-5qv5-52mj
  • github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2025-43857.yml
  • nvd.nist.gov/vuln/detail/CVE-2025-43857

Code Behaviors & Features

Detect and mitigate CVE-2025-43857 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 before 0.2.5, all versions starting from 0.3.0 before 0.3.9, all versions starting from 0.4.0 before 0.4.20, all versions starting from 0.5.0 before 0.5.7

Fixed versions

  • 0.5.7
  • 0.4.20
  • 0.3.9
  • 0.2.5

Solution

Upgrade to versions 0.2.5, 0.3.9, 0.4.20, 0.5.7 or above.

Weakness

  • CWE-400: Uncontrolled Resource Consumption
  • CWE-405: Asymmetric Resource Consumption (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-43857.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Wed, 14 May 2025 12:16:03 +0000.