CVE-2026-42245

net-imap: Quadratic complexity when reading response literals

Published May 9, 2026 CVSS 4.0 · 2.3 Low EPSS < 1% KEV · Not listed
Description
Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.4.24, 0.5.14, and 0.6.4, Net::IMAP::ResponseReader has quadratic time complexity when reading large responses containing many string literals. A hostile server can send responses which are crafted to exhaust the client's CPU for a denial of service attack. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.

Analysis

AI-generated

Technical impact

Net::IMAP contains an inefficient algorithm that processes server responses in quadratic time when large numbers of string literals are present. The result is that a malicious IMAP server can craft responses designed to exhaust the client’s CPU resources, causing a denial of service. The weakness is a classic example of inefficient string handling, catalogued as CWE‑407, and does not directly threaten data confidentiality or integrity.

Affected Systems

Ruby applications using the Net::IMAP library prior to versions 0.4.24, 0.5.14, or 0.6.4 are affected. These include any project that depends on the ruby:net-imap package with an older gem release, regardless of the surrounding application context.

Risk and Exploitability

The CVSS score of 2.3 indicates low severity, but the vulnerability can be exploited remotely by any IMAP server that the client connects to. Given the EPSS score of 0.00082, which denotes a very low probability of exploitation, and the fact that the vulnerability is not listed in the CISA KEV catalog, widespread exploitation is unlikely. The attack vector is inferred to be remote over the network, as a hostile server can send specially crafted responses to trigger the CPU exhaustion attack.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Net::IMAP gem to version 0.4.24, 0.5.14, or 0.6.4 or later.
  • Configure the application to connect only to trusted IMAP servers and enforce connection timeouts to limit the length of responses.
  • If an immediate upgrade is not feasible, add a wrapper around Net::IMAP that aborts processing when a response exceeds a configurable size or complexity threshold.

Generated by OpenCVE AI on May 16, 2026 at 01:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-q2mw-fvj9-vvcw net-imap has quadratic complexity when reading response literals
History
Type Values Removed Values Added
First Time appeared Ruby-lang net\
CPEs cpe:2.3:a:ruby-lang:net\:\:imap:*:*:*:*:*:ruby:*:*
Vendors & Products Ruby-lang net\
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

Type Values Removed Values Added
Weaknesses CWE-606
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Ruby-lang
Ruby-lang net::imap
Vendors & Products Ruby-lang
Ruby-lang net::imap
Type Values Removed Values Added
Description Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.4.24, 0.5.14, and 0.6.4, Net::IMAP::ResponseReader has quadratic time complexity when reading large responses containing many string literals. A hostile server can send responses which are crafted to exhaust the client's CPU for a denial of service attack. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.
Title net-imap: Quadratic complexity when reading response literals
Weaknesses CWE-407
References
Metrics cvssV4_0

{'score': 2.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-606

    Unchecked Input for Loop Condition

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 12, 2026, 6:30 PM
Reserved
Apr 25, 2026, 5:37 AM
Status
Analyzed
Published
May 9, 2026, 8:16 PM
Modified
Jul 24, 2026, 7:10 PM
Severity
Moderate
Public date
May 9, 2026, 7:37 PM