CVE-2026-42257
net-imap: Command Injection via "raw" arguments to multiple commands
Also known as GHSA-hm49-wcqc-g2xg
Mitigation
- Upgrade net-imap to one of 0.6.4, 0.5.14, 0.4.24 (or later in the same release line).
Who should check
- Projects that depend on RubyGems package net-imap (>= 0.6.0, < 0.6.4)
- Anyone running ruby net-imap < 0.4.24; >= 0.5.0, < 0.5.14; >= 0.6.0, < 0.6.4
Vulnerability facts
- Affected
- net-imap >= 0.6.0, < 0.6.4
- Fixed in
- 0.6.4, 0.5.14, 0.4.24
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 5.8 (v4.0, CNA)CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Attack requirements: Present
- Privileges required: None
- User interaction: Passive
- Confidentiality impact: None
- Integrity impact: High
- Availability impact: Low
- Confidentiality impact on other systems: None
- Integrity impact on other systems: None
- Availability impact on other systems: None
- EPSS
- 0.52% chance of exploitation in 30 days (percentile 37, 2026-11-26)
- CWE
- CWE-93, CWE-77
- Modified
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.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-42257. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-42257.md Affected: net-imap >= 0.6.0, < 0.6.4 Fixed in: 0.6.4, 0.5.14, 0.4.24 Steps: 1. Search this machine and project for net-imap (RubyGems), ruby net-imap: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
- https://github.com/ruby/net-imap/commit/0ec4fd351263e8b9a4f683713427827b7b1ad974
- https://github.com/ruby/net-imap/commit/47c72186d272441878ca73c9499f66013829ca2f
- https://github.com/ruby/net-imap/commit/6bf02aef7e0b5931010c36e377f79a71636b306b
- https://github.com/ruby/net-imap/commit/a4f7649c3da77dec7631f03a037a478eb4330048
- https://github.com/ruby/net-imap/commit/aec06996eb87a7e1bbcef1f9f8926e8add2b8c71
FAQ
Is CVE-2026-42257 being exploited?
There is no confirmed exploitation: CVE-2026-42257 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.52% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-42257?
Medium: CVSS 5.8 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2026-42257?
net-imap >= 0.6.0, < 0.6.4.
Is there a fix for CVE-2026-42257?
Yes. Fixed in 0.6.4, 0.5.14, 0.4.24. Upgrade net-imap to one of 0.6.4, 0.5.14, 0.4.24 (or later in the same release line).
How do I check if I'm affected by CVE-2026-42257?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.