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

- Severity: Medium 6.0 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.87%, higher than 57% of CVEs (2026-11-30)
- Published: 2025-04-28T14:17:32.000Z
- Modified: 2026-09-10T03:50:57.269Z
- Also known as: GHSA-j3g3-5qv5-52mj
- Weaknesses: CWE-400, CWE-405, CWE-770, CWE-789
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- ruby net-imap: >= 0.5.0, < 0.5.7; >= 0.4.0, < 0.4.20; >= 0.3.0, < 0.3.9; >= 0, < 0.2.5
- net-imap (RubyGems): from 0.5.0 before 0.5.7; from 0.4.0 before 0.4.20; from 0.3.0 before 0.3.9; before 0.2.5
- ruby-lang net::imap: before 0.2.5; from 0.3.0 before 0.3.9; from 0.4.0 before 0.4.20; from 0.5.0 before 0.5.7

## Every score

- GitHub_M: CVSS:4.0 6.0 Medium `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`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`

## References

- <https://github.com/ruby/net-imap/security/advisories/GHSA-j3g3-5qv5-52mj> (vendor-advisory, web)
- <https://github.com/ruby/net-imap/pull/442> (issue-tracking, patch, web)
- <https://github.com/ruby/net-imap/pull/444/commits/0ae8576c1a90bcd9573f81bdad4b4b824642d105#diff-53721cb4d9c3fb86b95cc8476ca2df90968ad8c481645220c607034399151462> (patch, web)
- <https://github.com/ruby/net-imap/pull/445> (issue-tracking, patch, web)
- <https://github.com/ruby/net-imap/pull/446> (issue-tracking, patch, web)
- <https://github.com/ruby/net-imap/pull/447> (issue-tracking, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-43857> (advisory)
- <https://github.com/ruby/net-imap/pull/444> (web)
- <https://github.com/ruby/net-imap> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2025-43857.yml> (web)

## Sources

- CVE List: [CVE-2025-43857](https://www.cve.org/CVERecord?id=CVE-2025-43857), CVE Terms of Use, modified 2025-04-28
- GitHub Advisory Database: [GHSA-j3g3-5qv5-52mj](https://github.com/advisories/GHSA-j3g3-5qv5-52mj), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-43857](https://nvd.nist.gov/vuln/detail/CVE-2025-43857), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-43857 · Whole record: https://cve.day/CVE-2025-43857.json · Rebuilt by cve.day 2026-11-25T22:58:57.016Z
