CVE-2025-43857
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.
Description as published by the source, in English.
Key facts
- Published
- 2025-04-28
- Last modified
- 2026-06-17
- Assigned by
- security-advisories@github.com
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H- Scored by
- nvd@nist.gov (NVD Primary)
- Probability of exploitation
-
0.5 %
higher than 38 %
of all known vulnerabilities
EPSS, next 30 days, model v2026.06.15 - Fix available
- Yes, see references
Affected products
| Vendor | Product | Versions | Status |
|---|---|---|---|
| net-imap (RubyGems) | < 0.2.5 | Affected | |
| net-imap (RubyGems) | ≥ 0.3.0, < 0.3.9 | Affected | |
| net-imap (RubyGems) | ≥ 0.4.0, < 0.4.20 | Affected | |
| net-imap (RubyGems) | ≥ 0.5.0, < 0.5.7 | Affected | |
| Ruby-lang | Net::imap | < 0.2.5 | Affected |
| Ruby-lang | Net::imap | ≥ 0.3.0, < 0.3.9 | Affected |
| Ruby-lang | Net::imap | ≥ 0.4.0, < 0.4.20 | Affected |
| Ruby-lang | Net::imap | ≥ 0.5.0, < 0.5.7 | Affected |
Weakness type
-
CWE-400: Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource.
-
CWE-405: Asymmetric Resource Consumption (Amplification)
The product does not properly control situations in which an adversary can cause the product to consume or produce excessive resources without requiring the adversary to invest equivalent work or otherwise prove authori…
-
CWE-770: Allocation of Resources Without Limits or Throttling
The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.
-
CWE-789: Memory Allocation with Excessive Size Value
The product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated.
Attack techniques
Derived through the weakness type: CVE to CWE to CAPEC to ATT&CK. This shows which techniques the weakness class is historically used for. It does not assert that this vulnerability has been exploited that way.
- T1498.001: Direct Network Flood
- T1498.002: Reflection Amplification
- T1499: Endpoint Denial of Service
- T1499.001: OS Exhaustion Flood
- T1499.002: Service Exhaustion Flood
- T1499.003: Application Exhaustion Flood
References
- https://github.com/ruby/net-imap/pull/442
- https://github.com/ruby/net-imap/pull/444/commits/0ae8576c1a90bcd9573f81bdad4b4b824642d10…
- https://github.com/ruby/net-imap/pull/445
- https://github.com/ruby/net-imap/pull/446
- https://github.com/ruby/net-imap/pull/447
- https://github.com/ruby/net-imap/security/advisories/GHSA-j3g3-5qv5-52mj
Does this affect you?
A vulnerability matters only if you run the product, in an affected version, somewhere an attacker can reach.