# CVE-2026-42257: net-imap: Command Injection via "raw" arguments to multiple commands

- Severity: Medium 5.8 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/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.43%, higher than 39% of CVEs (2026-12-01)
- Published: 2026-05-04T22:04:41.000Z
- Modified: 2026-09-10T03:51:05.961Z
- Also known as: GHSA-hm49-wcqc-g2xg
- Weaknesses: CWE-77, CWE-93
- 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.4.24, 0.5.14, and 0.6.4, several Net::IMAP commands accept a raw string argument that is sent to the server without validation or escaping. If this string is derived from user-controlled input, it may contain contain CRLF sequences, which an attacker can use to inject arbitrary IMAP commands. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.

(As written by CVE List.)

## Affected

- ruby net-imap: < 0.4.24; >= 0.5.0, < 0.5.14; >= 0.6.0, < 0.6.4
- net-imap (RubyGems): from 0.6.0 before 0.6.4; from 0.5.0 before 0.5.14; before 0.4.24
- ruby-lang net::imap: before 0.4.24; from 0.5.0 before 0.5.14; from 0.6.0 before 0.6.4

## Every score

- GitHub_M: CVSS:4.0 5.8 Medium `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/ruby/net-imap/security/advisories/GHSA-hm49-wcqc-g2xg> (mitigation, vendor-advisory, web)
- <https://github.com/ruby/net-imap/releases/tag/v0.4.24> (release-notes, web)
- <https://github.com/ruby/net-imap/releases/tag/v0.5.14> (release-notes, web)
- <https://github.com/ruby/net-imap/releases/tag/v0.6.4> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-42257> (advisory)
- <https://github.com/ruby/net-imap/commit/0ec4fd351263e8b9a4f683713427827b7b1ad974> (web)
- <https://github.com/ruby/net-imap/commit/47c72186d272441878ca73c9499f66013829ca2f> (web)
- <https://github.com/ruby/net-imap/commit/6bf02aef7e0b5931010c36e377f79a71636b306b> (web)
- <https://github.com/ruby/net-imap/commit/a4f7649c3da77dec7631f03a037a478eb4330048> (web)
- <https://github.com/ruby/net-imap/commit/aec06996eb87a7e1bbcef1f9f8926e8add2b8c71> (web)
- <https://github.com/ruby/net-imap> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2026-42257.yml> (web)

## Sources

- CVE List: [CVE-2026-42257](https://www.cve.org/CVERecord?id=CVE-2026-42257), CVE Terms of Use, modified 2026-05-13
- GitHub Advisory Database: [GHSA-hm49-wcqc-g2xg](https://github.com/advisories/GHSA-hm49-wcqc-g2xg), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-42257](https://nvd.nist.gov/vuln/detail/CVE-2026-42257), Public domain, modified 2026-07-24

---

Page: https://cve.day/CVE-2026-42257 · Whole record: https://cve.day/CVE-2026-42257.json · Rebuilt by cve.day 2026-11-25T22:59:21.149Z
