CVE-2026-42256 — Vulnerability in net-imap — CVE Details
net-imap vulnerable to denial of service via high iteration count for `SCRAM-*` authentication
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.52%). Schedule for your next planned update.
Does your project use an affected net-imap version?
Paste your Gemfile.lock to check it for CVE-2026-42256 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.pbkdf2_hmac 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.pbkdf2_hmac 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-imapthat adds themax_iterationsoption to theSASL-*authenticators, and callNet::IMAP#authenticatewith amax_iterationskeyword argument.NOTE: The default
max_iterationsis2³¹ - 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.
Advisory Timeline
- First published May 4, 2026 (206 days ago).
- Last revised September 10, 2026 — 128 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install net-imap -v 0.4.24
gem install net-imap -v 0.5.14
gem install net-imap -v 0.6.4
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (3)
Affects 1 ecosystem: RubyGems (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-1322
- CWE-770Allocation of Resources Without LimitsMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
References
- https://github.com/ruby/net-imap/security/advisories/GHSA-87pf-fpwv-p7m7WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-42256ADVISORY
- https://github.com/ruby/net-imap/commit/158d0b505074397cdb5ceb58935e42dd2bcfa612WEB
- https://github.com/ruby/net-imap/commit/808001bc45c06f7297a7e96d341279e041a7f7f4WEB
- https://github.com/ruby/net-imap/commit/99f59eab6064955a23debd95410263ad144df758WEB
- https://github.com/ruby/net-imapPACKAGE
- https://github.com/ruby/net-imap/releases/tag/v0.4.24WEB
- https://github.com/ruby/net-imap/releases/tag/v0.5.14WEB
- https://github.com/ruby/net-imap/releases/tag/v0.6.4WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2026-42256.ymlWEB
- https://www.rfc-editor.org/rfc/rfc7804.html#page-15WEB
Frequently Asked Questions
- What is CVE-2026-42256?
- net-imap vulnerable to denial of service via high iteration count for `SCRAM-*` authentication. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
- How do I check if my project is affected by CVE-2026-42256?
- CVE-2026-42256 affects net-imap. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42256 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 37.4% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-42246HIGH
net-imap vulnerable to STARTTLS stripping via invalid response timing
- CVE-2026-47242MEDIUM
Net::IMAP: Command Injection via ID command argument
- CVE-2026-42258MEDIUM
net-imap vulnerable to command Injection via unvalidated Symbol inputs
- CVE-2025-25186MEDIUM
Possible DoS by memory exhaustion in net-imap
- CVE-2026-47240MEDIUM
Net::IMAP: Command Injection via non-synchronizing literal in "raw" argument
- CVE-2026-42257MEDIUM
net-imap vulnerable to command Injection via "raw" arguments to multiple commands
- CVE-2025-43857MEDIUM
net-imap rubygem vulnerable to possible DoS by memory exhaustion
- CVE-2026-42245LOW
net-imap has quadratic complexity when reading response literals