net-imap rubygem vulnerable to possible DoS by memory exhaustion
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 5 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-400.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| ruby | net-imap | 0.5.0 to before 0.5.7; 0.4.0 to before 0.4.20; 0.3.0 to before 0.3.9; before 0.2.5 | 0.5.7, 0.4.20, 0.3.9, 0.2.5 | Patch available | CNA |
| — | net-imap (RubyGems) | 0.5.0 to before 0.5.7 | 0.5.7 | Patch available | GHSA-j3g3-5qv5-52mj |
| — | net-imap (RubyGems) | 0.4.0 to before 0.4.20 | 0.4.20 | Patch available | GHSA-j3g3-5qv5-52mj |
| — | net-imap (RubyGems) | 0.3.0 to before 0.3.9 | 0.3.9 | Patch available | GHSA-j3g3-5qv5-52mj |
| — | net-imap (RubyGems) | before 0.2.5 | 0.2.5 | Patch available | GHSA-j3g3-5qv5-52mj |
- net-imap Vendorruby Affected 0.5.0 to before 0.5.7; 0.4.0 to before 0.4.20; 0.3.0 to before 0.3.9; before 0.2.5 Fixed in 0.5.7, 0.4.20, 0.3.9, 0.2.5 Patch available CNA
- net-imap (RubyGems) Vendor— Affected 0.5.0 to before 0.5.7 Fixed in 0.5.7 Patch available GHSA-j3g3-5qv5-52mj
- net-imap (RubyGems) Vendor— Affected 0.4.0 to before 0.4.20 Fixed in 0.4.20 Patch available GHSA-j3g3-5qv5-52mj
- net-imap (RubyGems) Vendor— Affected 0.3.0 to before 0.3.9 Fixed in 0.3.9 Patch available GHSA-j3g3-5qv5-52mj
- net-imap (RubyGems) Vendor— Affected before 0.2.5 Fixed in 0.2.5 Patch available GHSA-j3g3-5qv5-52mj
Remediation
- Fix · CNA net-imap (ruby) Fixed in 0.5.7, 0.4.20, 0.3.9, 0.2.5
- Fix · GHSA-j3g3-5qv5-52mj net-imap (RubyGems) Fixed in 0.5.7 Advisory →
- Fix · GHSA-j3g3-5qv5-52mj net-imap (RubyGems) Fixed in 0.4.20 Advisory →
- Fix · GHSA-j3g3-5qv5-52mj net-imap (RubyGems) Fixed in 0.3.9 Advisory →
- Fix · GHSA-j3g3-5qv5-52mj net-imap (RubyGems) Fixed in 0.2.5 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Logging Subsystem for Red Hat OpenShift | Affected | No fix yet: Fix deferred |
| Red Hat 3scale API Management Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 10 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 8 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 9 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-43857
- 2026-10-03 Alias added: GHSA-j3g3-5qv5-52mj
References
Patch 5
- https://github.com/ruby/net-imap/pull/442
- https://github.com/ruby/net-imap/pull/444/commits/0ae8576c1a90bcd9573f81bdad4b4b824642d105#diff-53721cb4d9c3fb86b95cc8476ca2df90968ad8c481645220c607034399151462
- https://github.com/ruby/net-imap/pull/445
- https://github.com/ruby/net-imap/pull/446
- https://github.com/ruby/net-imap/pull/447
Advisory 2
More ruby Net vulnerabilities
- TI-2026-30563 net-imap vulnerable to STARTTLS stripping via invalid response timing CVSS 4.0HIGH 7.6
- TI-2026-30574 net-imap: Command Injection via unvalidated Symbol inputs CVSS 4.0MEDIUM 5.8
- TI-2026-30572 net-imap: Denial of service via high iteration count for `SCRAM-*` authentication CVSS 4.0MEDIUM 6.0
- TI-2026-30573 net-imap: Command Injection via "raw" arguments to multiple commands CVSS 4.0MEDIUM 5.8
- TI-2026-30562 net-imap: Quadratic complexity when reading response literals CVSS 4.0LOW 2.3
Sources
- CVE-2025-43857 · CVE Program
- CVE-2025-43857 · NVD
- FIRST EPSS
- GHSA-j3g3-5qv5-52mj · GitHub Advisory Database · CC BY 4.0
- CVE-2025-43857 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences