NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
💎 RubyGems
Not in CISA KEV

net-imap has quadratic complexity when reading response literalsGHSA-q2mw-fvj9-vvcw

Fix: ruby/net-imap@6091f7d

GHSA-q2mw-fvj9-vvcw is a CWE-407 vulnerability in net-imap. A fix is available for net-imap — see the affected versions and patch details below.

Also known asCVE-2026-42245
Published
Updated
Affected
3 pkgs
Patched
3 / 3
Exploits
None indexed
Exploitation data as of Nov 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-q2mw-fvj9-vvcw.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs36th percentile — riskier than 36% of all scored CVEsHighest risk
0.00%0.40%0.80%1.20%0.1%0.4%0.7%0.4%0.4%Jun 26Oct 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

Real-World Exposure

3 pkgs affected
💎net-imap💎net-imap💎net-imap

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.

Description

Summary

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.

Details

For each literal in a response, ResponseReader rescans the entire growing response buffer. The regular expression that is used to scan the response buffer runs in linear time. With many literals, this becomes O(n²) total work. The regular expression should run in constant time: it is anchored to the end and only the last 23 bytes of the buffer are relevant.

Because the algorithmic complexity is super-linear, this bypasses protection from max_response_size: a response can stay well below the default size limit while still causing very large CPU cost.

Net::IMAP::ResponseReader runs continuously in the receiver thread until the connection closes.

Impact

This consumes disproportionate CPU time in the client's receiver thread. A hostile server could use this to exhaust the client's CPU for a denial of service attack.

For a response near the default max_response_size, each individual regexp scan could take between 100 to 200ms on common modern hardware, and this may be repeated 200k times per megabyte of response. While the regexp is scanning, it retains the Global VM lock, preventing other threads from running.

Although other threads should not be completely blocked, their run time will be significantly impacted.

Mitigation

  • Upgrade to a patched version of net-imap that reads responses more efficiently.
  • Do not connect to untrusted IMAP servers.
  • When connecting to untrusted servers, a much smaller max_response_size (for example: 8KiB) will limit the impact. Although this is too small for fetching unpaginated message bodies, it should be enough for most other operations.

Affected Packages

3 total 3 fixed
EcosystemPackageVulnerable rangeFix
💎RubyGemsnet-imap≥ 0.6.0&&< 0.6.40.6.4bundle update net-imap --conservative
💎RubyGemsnet-imap≥ 0.5.0&&< 0.5.140.5.14bundle update net-imap --conservative
💎RubyGemsnet-imapall versions0.4.24bundle update net-imap --conservative

Affected Products

1 product · 3 configurations
Application
net\ruby-lang
≥ 0.6.0 && < 0.6.4
1 version
\

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for net-imap, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update net-imap to 0.6.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-q2mw-fvj9-vvcw is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate

Red Hat has rated this flaw as Moderate because a malicious IMAP server can trigger excessive CPU consumption, resulting in a denial-of-service (DoS) condition in client applications using the affected Net::IMAP library. Successful exploitation requires interaction with a hostile server, and the impact is strictly…

Workaround published by Red Hat
To reduce the risk of a denial of service, ensure that applications using the Net::IMAP library are configured to connect exclusively to trusted IMAP servers. Avoid connecting to untrusted or unverified IMAP services, as a hostile server can exploit this vulnerability. This operational control helps prevent exposure to malicious IMAP response processing.
Source: Red Hat security advisory for GHSA-q2mw-fvj9-vvcw (CC BY 4.0)
ProductFixed inAdvisory
Red Hat Enterprise Linux 10ruby4.0-0:4.0.3-35.el10_2RHSA-2026:33540
Red Hat Enterprise Linux 10ruby-0:3.3.10-13.el10_2RHSA-2026:33565
Red Hat Enterprise Linux 10.0 Extended Update Supportruby-0:3.3.10-11.el10_0.2RHSA-2026:35895
Red Hat Enterprise Linux 8ruby:3.3-8100020260615131010.489197e6RHSA-2026:33515
Red Hat Enterprise Linux 9ruby:3.3-9080020260615131001.9RHSA-2026:33576
Red Hat Enterprise Linux 9ruby:4.0-9080020260619130154.9RHSA-2026:33577
Red Hat Enterprise Linux 9.4 Update Services for SAP Solutionsruby:3.3-9040020260630065449.9RHSA-2026:36099
Red Hat Enterprise Linux 9.6 Extended Update Supportruby:3.3-9060020260630075016.9RHSA-2026:37238

Frequently Asked Questions

### Summary `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. ### Details For each literal in a response, `ResponseReader` rescans the entire growing response buffer. The regular expression that is used to scan the response buffer runs in linear time. With many literals, this becomes O(n²) total work. The regular expression should run in constant time: it is anchored to the end and only the last 23 bytes o
O3 Security · Impact-Aware SCA

Is GHSA-q2mw-fvj9-vvcw in your dependencies?

Find it across RubyGems, including transitive dependencies.

GHSA-q2mw-fvj9-vvcw: net-imap DoS — Fixed in 0.6.4