CVE-2025-43857: net-imap rubygem vulnerable to possible DoS by memory exhaustion
(updated )
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 →