# CVE-2026-42245: Ruby Net::IMAP denial of service in ResponseReader

Source: https://junglewise.ai/threats/cve-2026-42245-ruby-net-imap-denial-of-service-in-responsereader  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-09. Updated: 2026-05-18  
License: CC BY 4.0 with a link back

CVE-2026-42245 · Severity: high · CVSS 7.5 · Published 2026-05-09

The Net::IMAP library, used by Ruby applications to communicate with email servers, is vulnerable to a denial-of-service attack. A malicious or compromised email server can send specially crafted responses that cause the Ruby application to consume excessive CPU resources. This can lead to the application becoming unresponsive, potentially disrupting email processing services.

Technologies: [net-imap (RubyGems)](https://junglewise.ai/threats/technologies/net-imap). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2026-42245 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-42245 being exploited in the wild.

**How severe is CVE-2026-42245?** High severity, with a CVSS score of 7.5, published 9 May 2026.

**Which products and versions are affected?** net-imap (RubyGems) ECOSYSTEM:introduced=0.6.0,fixed=0.6.4.

**Is there a fix for CVE-2026-42245?** Yes. net-imap (RubyGems): upgrade to 0.6.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-42245 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-42245?** Check whether you run net-imap (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- net-imap (RubyGems): upgrade to 0.6.4 or later

  ```sh
  bundle update net-imap
  ```


## Technical details

The vulnerability exists in the Net::IMAP::ResponseReader component of the Ruby Net::IMAP library. It is caused by inefficient algorithmic complexity (CWE-407) when parsing large IMAP server responses that contain a high volume of string literals, leading to quadratic time complexity. A remote attacker controlling a hostile IMAP server can exploit this by sending a crafted response to a client, exhausting the client's CPU and causing a denial of service. The issue is fixed in versions 0.4.24, 0.5.14, and 0.6.4 by optimizing the response reader performance.

## Affected products

- Ruby Net::IMAP < 0.4.24, 0.5.0 to < 0.5.14, 0.6.0 to < 0.6.4

## Identifiers

- CVE-2026-42245
- GHSA-q2mw-fvj9-vvcw

## Timeline

- 2026-05-09: disclosed
- 2026-04-23: patched: Release of versions 0.4.24 and 0.5.14

## References

- [https://github.com/ruby/net-imap/commit/6091f7d6b1f3514cafbfe39c76f2b5d73de3ca96](https://github.com/ruby/net-imap/commit/6091f7d6b1f3514cafbfe39c76f2b5d73de3ca96)
- [https://github.com/ruby/net-imap/commit/88d95231fc8afef11c1f074453f7d75b68c9dfda](https://github.com/ruby/net-imap/commit/88d95231fc8afef11c1f074453f7d75b68c9dfda)
- [https://github.com/ruby/net-imap/commit/de685f91a4a4cc75eb80da898c2bf8af08d34819](https://github.com/ruby/net-imap/commit/de685f91a4a4cc75eb80da898c2bf8af08d34819)
- [https://github.com/ruby/net-imap/releases/tag/v0.4.24](https://github.com/ruby/net-imap/releases/tag/v0.4.24)
- [https://github.com/ruby/net-imap/releases/tag/v0.5.14](https://github.com/ruby/net-imap/releases/tag/v0.5.14)
- [https://github.com/ruby/net-imap/releases/tag/v0.6.4](https://github.com/ruby/net-imap/releases/tag/v0.6.4)
- [https://github.com/ruby/net-imap/security/advisories/GHSA-q2mw-fvj9-vvcw](https://github.com/ruby/net-imap/security/advisories/GHSA-q2mw-fvj9-vvcw)

## Related threats

- [Ruby Net::IMAP command injection in ID and ENABLE commands](https://junglewise.ai/threats/cve-2026-47242-ruby-net-imap-command-injection-in-id-and-enable-commands)
- [Ruby Net::IMAP denial of service via incomplete raw argument validation](https://junglewise.ai/threats/cve-2026-47241-ruby-net-imap-denial-of-service-via-incomplete-raw-argument)
- [Ruby Net::IMAP command injection via non-synchronizing literals](https://junglewise.ai/threats/cve-2026-47240-ruby-net-imap-command-injection-via-non-synchronizing-literals)
- [Ruby Net::IMAP command injection via Symbol arguments](https://junglewise.ai/threats/cve-2026-42258-ruby-net-imap-command-injection-via-symbol-arguments)
- [Ruby Net::IMAP command injection in multiple commands](https://junglewise.ai/threats/cve-2026-42257-ruby-net-imap-command-injection-in-multiple-commands)
