Executive brief
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.
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
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/808001bc45c06f7297a7e96d341279e041a7f7f4
- 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.5.14
- https://github.com/ruby/net-imap/releases/tag/v0.6.4
- https://github.com/ruby/net-imap/security/advisories/GHSA-87pf-fpwv-p7m7