# CVE-2026-42256: Ruby Net::IMAP computational DoS in SCRAM authentication

Source: https://junglewise.ai/threats/cve-2026-42256-ruby-net-imap-computational-dos-in-scram-authentication  
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-42256 · Severity: medium · CVSS 6.5 · Published 2026-05-09

Net::IMAP is a Ruby library used by applications to communicate with email servers. A vulnerability exists where a malicious or compromised email server can send a specially crafted response during the login process that forces the client application to perform excessive calculations. This can cause the application to become unresponsive or crash, leading to a denial of service for the user or system relying on the email connection.

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

## Quick answers

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

**How severe is CVE-2026-42256?** Medium severity, with a CVSS score of 6.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-42256?** 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-42256 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-42256?** 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

A computational denial-of-service (DoS) vulnerability exists in the Net::IMAP library for Ruby when using SCRAM-SHA1 or SCRAM-SHA256 authentication. The root cause is the lack of a limit on the iteration count provided by the server during the SASL SCRAM exchange, leading to excessive CPU consumption in the client process (CWE-770, CWE-1322). An attacker controlling a hostile IMAP server can trigger this by sending a very large iteration count value in the server-first-message. The issue is addressed by introducing a configurable `max_iterations` setting in the `ScramAuthenticator`. Patches are available in versions 0.4.24, 0.5.14, and 0.6.4.

## Affected products

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

## Identifiers

- CVE-2026-42256
- GHSA-87pf-fpwv-p7m7

## Timeline

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

## References

- [https://github.com/ruby/net-imap/commit/158d0b505074397cdb5ceb58935e42dd2bcfa612](https://github.com/ruby/net-imap/commit/158d0b505074397cdb5ceb58935e42dd2bcfa612)
- [https://github.com/ruby/net-imap/commit/808001bc45c06f7297a7e96d341279e041a7f7f4](https://github.com/ruby/net-imap/commit/808001bc45c06f7297a7e96d341279e041a7f7f4)
- [https://github.com/ruby/net-imap/commit/99f59eab6064955a23debd95410263ad144df758](https://github.com/ruby/net-imap/commit/99f59eab6064955a23debd95410263ad144df758)
- [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-87pf-fpwv-p7m7](https://github.com/ruby/net-imap/security/advisories/GHSA-87pf-fpwv-p7m7)

## 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)
