# CVE-2025-43857: net-imap rubygem vulnerable to possible DoS by memory exhaustion

- Priority: **Routine**
- Reason: Not severe (CVSS 6, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-04-28 · Modified: 2025-04-28
- Aliases: ALPINE-CVE-2025-43857, UBUNTU-CVE-2025-43857, DEBIAN-CVE-2025-43857, CGA-2pmm-4mx4-233x, CGA-3qc5-fx32-66r2, CGA-46rm-328c-gpvq, CGA-4g72-hxc5-67w9, CGA-4r4r-p4cq-8j9m, CGA-7f69-qvp7-pcjx, CGA-cqgh-hq94-7vwm, CGA-fpx5-h7cg-66c3, CGA-g6hw-7j8r-r833, CGA-grjp-r68g-3v44, CGA-h6gv-xcjx-mx2w, CGA-jf5w-m88q-73q8, CGA-m353-v5cg-3vq5, CGA-m99v-j3f2-m45g, CGA-qj44-h3hx-78wg, CGA-qj57-h8f9-2qq3, CGA-r2xq-fcpp-g3cv, CGA-vjq6-qx5x-whc4, CGA-475f-hhp2-p3r9, CGA-4x59-38qj-vq5x, CGA-5jx2-9cx2-h45x, CGA-8v3w-8pvh-7hqg, CGA-9x84-m822-w4rm, CGA-cjj7-74q8-9p79, GHSA-j3g3-5qv5-52mj, CGA-qc3g-j56v-m9vq, CGA-rp4c-5744-5w6h, CGA-rrfh-jrjf-c6mh, CGA-rwwf-w852-m3r9, CGA-vc5g-frq8-xcwx, CGA-w7mv-9gfv-cgwq
- Record: https://cvemate.com/vulnerability/CVE-2025-43857 · JSON: https://cvemate.com/vulnerability/CVE-2025-43857/json

## Description

```text
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.
```

## Signals

- CVSS: 6.5 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- EPSS: 0.508%, percentile 44.961%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 35)

- alpine ruby-net-imap (Alpine Linux): \< 0.4.22-r0
- chainguard gitlab-rails-ce-18.1 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.2 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.1 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.2 (Chainguard): All versions (No fix recorded)
- chainguard graalvm-24-truffleruby (Chainguard): All versions (No fix recorded)
- chainguard jruby-9.4 (Chainguard): \< 9.4.13.0-r0
- chainguard jruby-9.4-default-ruby (Chainguard): \< 9.4.13.0-r0
- chainguard kube-fluentd-operator (Chainguard): \< 1.18.2-r36
- chainguard kube-fluentd-operator-compat (Chainguard): \< 1.18.2-r36
- chainguard kube-fluentd-operator-default-config (Chainguard): \< 1.18.2-r36
- chainguard kube-fluentd-operator-oci-entrypoint (Chainguard): \< 1.18.2-r36
- chainguard logstash-8-with-output-opensearch (Chainguard): All versions (No fix recorded)
- chainguard ruby-3.1 (Chainguard): All versions (No fix recorded)
- chainguard ruby-3.1-dev (Chainguard): All versions (No fix recorded)
- chainguard truffleruby (Chainguard): \< 34.0.1-r0
- wolfi jruby-9.4 (Wolfi): \< 9.4.13.0-r0
- wolfi jruby-9.4-default-ruby (Wolfi): \< 9.4.13.0-r0
- wolfi kube-fluentd-operator (Wolfi): \< 1.18.2-r36
- wolfi kube-fluentd-operator-compat (Wolfi): \< 1.18.2-r36

## 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>
- <https://security.alpinelinux.org/vuln/CVE-2025-43857>
- <https://ubuntu.com/security/CVE-2025-43857>
- <https://www.cve.org/CVERecord?id=CVE-2025-43857>
- <https://security-tracker.debian.org/tracker/CVE-2025-43857>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/43xxx/CVE-2025-43857.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2025-43857>
- <https://github.com/ruby/net-imap/pull/444>
- <https://github.com/ruby/net-imap>
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2025-43857.yml>

---

Data as of 2026-12-05T04:21:28.097Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
