Vulnerability · Published Apr 28, 2025 · Assigned by GitHub_M
CVE-2025-43857net-imap rubygem vulnerable to possible DoS by memory exhaustion
Medium 6.0
In plain English
A medium-severity uncontrolled resource consumption in net-imap from ruby. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 43% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.5.7, 0.4.20, 0.3.9, and 0.2.5, 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). This issue has been patched in versions 0.5.7, 0.4.20, 0.3.9, and 0.2.5.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | ruby-net-imap | 0.4.22-r0 | ALPINE-CVE-2025-43857 |
| Alpine:v3.21 | ruby-net-imap | 0.4.22-r0 | ALPINE-CVE-2025-43857 |
| Debian:12 | ruby3.1 | no fix listed | DEBIAN-CVE-2025-43857 |
| Debian:13 | ruby3.3 | no fix listed | DEBIAN-CVE-2025-43857 |
| Debian:14 | ruby3.3 | no fix listed | DEBIAN-CVE-2025-43857 |
| RubyGems | net-imap | 0.2.5 | GHSA-j3g3-5qv5-52mj |
| RubyGems | net-imap | 0.5.7 | GHSA-j3g3-5qv5-52mj |
| RubyGems | net-imap | 0.4.20 | GHSA-j3g3-5qv5-52mj |
| RubyGems | net-imap | 0.3.9 | GHSA-j3g3-5qv5-52mj |
| Ubuntu:24.04:LTS | jruby | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:25.10 | jruby | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:26.04:LTS | jruby | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:26.10 | jruby | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:22.04:LTS | ruby3.0 | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:24.04:LTS | ruby3.2 | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:25.10 | ruby3.3 | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:26.04:LTS | ruby3.3 | no fix listed | UBUNTU-CVE-2025-43857 |
| Ubuntu:26.10 | ruby3.3 | no fix listed | UBUNTU-CVE-2025-43857 |
Affected products (as reported)
Weakness: CWE-400, CWE-770, CWE-789, CWE-405 · Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
References
- https://github.com/ruby/net-imap/security/advisories/GHSA-j3g3-5qv5-52mj x_refsource_CONFIRM
- https://github.com/ruby/net-imap/pull/442 x_refsource_MISC
- https://github.com/ruby/net-imap/pull/444/commits/0ae8576c1a90bcd9573f81bdad4b4b824642d105#diff-53721cb4d9c3fb86b95cc8476ca2df90968ad8c481645220c607034399151462 x_refsource_MISC
- https://github.com/ruby/net-imap/pull/445 x_refsource_MISC
- https://github.com/ruby/net-imap/pull/446 x_refsource_MISC
- https://github.com/ruby/net-imap/pull/447 x_refsource_MISC