CVE-2025-43857net-imap rubygem vulnerable to possible DoS by memory exhaustion
Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.5.7, 0.4.20, 0.3.9, and 0.2.5, there is a possibility for denial of service by memory exhaustion when net-imap reads server responses. At any time while the client is connected, a malicious server can send can send a "literal" byte count, which is automatically read by the client's receiver thread. The response reader immediately allocates memory for the number of bytes indicated by the server response. This should not be an issue when securely connecting to trusted IMAP servers that are well-behaved. It can affect insecure connections and buggy, untrusted, or compromised servers (for example, connecting to a user supplied hostname). This issue has been patched in versions 0.5.7, 0.4.20, 0.3.9, and 0.2.5.
What to do
Fixed builds are available from Alpine, RubyGems: see the table below for the fixed version per release.
Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | jruby | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 26.10 | ruby3.3 | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 26.04 | jruby | Under investigation | UBUNTU-CVE-2025-43857 | |
| Ubuntu 26.04 | ruby3.3 | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 25.10 | jruby | Will not fix ruby3.0 contains net-imap 0.1.1 ruby3.2 contains net-imap 0.3.4.1 ruby3.3 contains net-imap 0.4.9.1 This fix introduces a new max_response_size to the API,… | UBUNTU-CVE-2025-43857 | |
| Ubuntu 25.10 | ruby3.3 | Will not fix ruby3.0 contains net-imap 0.1.1 ruby3.2 contains net-imap 0.3.4.1 ruby3.3 contains net-imap 0.4.9.1 This fix introduces a new max_response_size to the API,… | UBUNTU-CVE-2025-43857 | |
| Ubuntu 24.04 | jruby | Under investigation | UBUNTU-CVE-2025-43857 | |
| Ubuntu 24.04 | ruby3.2 | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 22.04 | ruby3.0 | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 20.04 | jruby | Will not fix ruby3.0 contains net-imap 0.1.1 ruby3.2 contains net-imap 0.3.4.1 ruby3.3 contains net-imap 0.4.9.1 This fix introduces a new max_response_size to the API,… | UBUNTU-CVE-2025-43857 | |
| Ubuntu 20.04 | ruby2.7 | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 18.04 | jruby | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 18.04 | ruby2.5 | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 16.04 | jruby | Fix pending | UBUNTU-CVE-2025-43857 | |
| Ubuntu 14.04 | jruby | Fix pending | UBUNTU-CVE-2025-43857 | |
| Debian 14 | ruby3.3 | Fix pending | DEBIAN-CVE-2025-43857 | |
| Debian 13 | ruby3.3 | Fix pending | DEBIAN-CVE-2025-43857 | |
| Debian 12 | ruby3.1 | Fix pending | DEBIAN-CVE-2025-43857 | |
| Red Hat Enterprise Linux 10 | ruby | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | ruby-bundled-gems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | ruby-default-gems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | ruby-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | ruby-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | ruby-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-bigdecimal | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-bundler | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-io-console | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-irb | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-json | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-minitest | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-power_assert | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-psych | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-racc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-rake | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-rbs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-rdoc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-rexml | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-rss | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-test-unit | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygem-typeprof | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | rubygems-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | ruby | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | ruby-default-gems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | ruby-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | ruby-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | ruby-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-bigdecimal | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-bundler | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-io-console | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-irb | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-json | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-minitest | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-power_assert | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-psych | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-rake | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-rbs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-rdoc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-rexml | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-rss | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-test-unit | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygem-typeprof | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | rubygems-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | ruby | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | ruby-bundled-gems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | ruby-default-gems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | ruby-devel | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | ruby-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | ruby-irb | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | ruby-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-abrt | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-abrt-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-bigdecimal | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-bson | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-bson-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-bundler | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-bundler-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-did_you_mean | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-io-console | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-irb | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-json | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-minitest | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-mongo | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-mongo-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-mysql2 | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-mysql2-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-net-telnet | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-openssl | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-pg | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-pg-doc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-power_assert | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-psych | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-racc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-rake | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-rbs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-rdoc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-rexml | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-rss | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-test-unit | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-typeprof | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygem-xmlrpc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygems | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | rubygems-devel | Fix pending Fix deferred | ||
| Alpine Linux 3.21 | ruby-net-imap | Fixed | 0.4.22-r0 | ALPINE-CVE-2025-43857 |
| Alpine Linux 3.20 | ruby-net-imap | Fixed | 0.4.22-r0 | ALPINE-CVE-2025-43857 |
| RubyGems library | net-imap | Fixed | 0.5.7 | GHSA-j3g3-5qv5-52mj |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- ruby net-imap: affected: >= 0.5.0, < 0.5.7, >= 0.4.0, < 0.4.20, >= 0.3.0, < 0.3.9, >= 0, < 0.2.5
References
- https://github.com/ruby/net-imap/security/advisories/GHSA-j3g3-5qv5-52mj
- https://github.com/ruby/net-imap/pull/442
- https://github.com/ruby/net-imap/pull/444/commits/0ae8576c1a90bcd9573f81bdad4b4b824642d105#diff-53721cb4d9c3fb86b95cc8476ca2df90968ad8c481645220c607034399151462
- https://github.com/ruby/net-imap/pull/445
- https://github.com/ruby/net-imap/pull/446
- https://github.com/ruby/net-imap/pull/447
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.