CVE-2026-42258 net-imap: Command Injection via unvalidated Symbol inputs
Attackers can inject IMAP commands via unvalidated Symbol arguments in the Ruby net-imap library, potentially executing arbitrary commands or modifying data.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-42258?
CVE-2026-42258 is a medium-severity command injection vulnerability in ruby net-imap, published on 9 May 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official 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, symbol arguments to commands are vulnerable to a CRLF Injection / IMAP Command injection via Symbol arguments passed to IMAP commands. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.
Which versions are affected by CVE-2026-42258?
6 open source packages ship an affected version, including net-imap. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
net-imap RubyGems | All versions | 0.4.24 |
net-imap RubyGems | All versions | 0.4.24 |
net-imap RubyGems | From 0.5.0 | 0.5.14 |
net-imap RubyGems | From 0.5.0 | 0.5.14 |
net-imap RubyGems | From 0.6.0 | 0.6.4 |
net-imap RubyGems | From 0.6.0 | 0.6.4 |
Products include Ruby-Lang Net\.
How do I fix CVE-2026-42258?
Upgrade net-imap to a fixed version for your release line: 0.4.24, 0.5.14 or 0.6.4.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-42258 being exploited?
There is no known exploitation of CVE-2026-42258 in the wild and no public exploit code.
Other vulnerabilities in ruby net-imap
- CVE-2026-42246 net-imap vulnerable to STARTTLS stripping via invalid response timing
- CVE-2026-42256 net-imap: Denial of service via high iteration count for `SCRAM-*` authentication
- CVE-2025-43857 net-imap rubygem vulnerable to possible DoS by memory exhaustion
- CVE-2026-42257 net-imap: Command Injection via "raw" arguments to multiple commands
- CVE-2026-42245 net-imap: Quadratic complexity when reading response literals
Sources
Also known as ALPINE-CVE-2026-42258, BELL-CVE-2026-42258, CLEANSTART-2026-SF71798, CLEANSTART-2026-TS16592, CLSA-2026-1783695736, DEBIAN-CVE-2026-42258 and 20 more.