CVE-2026-42256: net-imap: Denial of service via high iteration count for `SCRAM-*` authentication

Published May 4, 2026
·
Updated

Summary

When authenticating a connection with SCRAM-SHA1 or SCRAM-SHA256, a hostile server can perform a computational denial-of-service attack on the client process by sending a big iteration count value.

Details

A hostile IMAP server can send an arbitrarily large PBKDF2 iteration count in the SCRAM server-first-message, causing the client to perform an expensive OpenSSL::KDF.pbkdf2hmac call. Because the PBKDF2 function is a blocking C extension and holds onto Ruby’s Global VM Lock, it can freeze the entire Ruby VM for the duration of the computation.

OpenSSL enforces an effective maximum by using a 32-bit signed integer for the iteration count, Depending on hardware capabilities and OpenSSL version, this iteration count may be sufficient for to block all Ruby threads in the process for over seven minutes.

This is listed as one of the "Security Considerations", in RFC 7804: > A hostile server can perform a computational denial-of-service attack on clients by sending a big iteration count value. In order to defend against that, a client implementation can pick a maximum iteration count that it is willing to use and reject any values that exceed that threshold (in such cases, the client, of course, has to fail the authentication).

Impact

During SCRAM authentication to a hostile server, the entire Ruby VM will be locked for the duration of the computation. Depending on hardware capabilities and OpenSSL version, this may take many minutes.

OpenSSL::KDF.pbkdf2hmac is a blocking C function, so Timeout cannot be used to guard against this. And it retains the Global VM lock, so other ruby threads will also be unable to run.

Mitigation

Upgrade to a patched version of net-imap that adds the maxiterations option to the SASL- authenticators, and call Net::IMAP#authenticate with a maxiterations keyword argument.

NOTE: The default maxiterations is 2³¹ - 1, the maximum signed 32 bit integer, the maximum allowed by OpenSSL. To prevent a denial of service attack, this must be set to a safe value, depending on hardware and version of OpenSSL. It is the user's responsibility to enforce minimum and maximum iteration counts that are appropriate for their security context. Alternatively, avoid SCRAM- mechanisms when authenticating to untrusted servers.

Other sources

Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. From versions 0.4.0 to before 0.4.24, 0.5.0 to before 0.5.14, and 0.6.0 to before 0.6.4, when authenticating a connection with SCRAM-SHA1 or SCRAM-SHA256, a hostile server can perform a computational denial-of-service attack on the client process by sending a big iteration count value. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.

MITRE

Affected Software

6 affected componentsFixes available
rubygems/net-imap>=0.4.0<=0.4.23
0.4.24
rubygems/net-imap>=0.5.0<=0.5.13
0.5.14
rubygems/net-imap>=0.6.0<=0.6.3
0.6.4
ruby-lang Net\>=0.4.0<0.4.24
ruby-lang Net\>=0.5.0<0.5.14
ruby-lang Net\>=0.6.0<0.6.4

Event History

May 4, 2026
Advisory Published
via GitHub·10:03 PM
Data Sourced
via GitHub·10:03 PM
DescriptionWeaknessAffected Software
May 9, 2026
CVE Published
via MITRE·07:38 PM
Data Sourced
via MITRE·07:38 PM
DescriptionWeakness
Data Sourced
via NVD·08:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-42256?

CVE-2026-42256 has a high severity rating due to its potential for causing a denial-of-service attack.

2

How do I fix CVE-2026-42256?

To fix CVE-2026-42256, update the net-imap package to version 0.4.24, 0.5.14, or 0.6.4, depending on your current version.

3

What are the affected versions for CVE-2026-42256?

The affected versions of net-imap for CVE-2026-42256 are any version from 0.4.0 to 0.4.23, 0.5.0 to 0.5.13, and 0.6.0 to 0.6.3.

4

What type of attack does CVE-2026-42256 exploit?

CVE-2026-42256 exploits the SCRAM-SHA1 or SCRAM-SHA256 authentication process to launch a computational denial-of-service attack.

5

Who is affected by CVE-2026-42256?

Any user or application utilizing the vulnerable versions of the net-imap library for IMAP connections is affected by CVE-2026-42256.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203