CVE-2026-47242 Net::IMAP: Command Injection via ID command argument
Attackers can inject arbitrary IMAP commands via unsanitized arguments in the Ruby Net::IMAP library, potentially leading to code execution.
- 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-47242?
CVE-2026-47242 is a medium-severity command injection vulnerability in ruby net-imap, published on 22 Jun 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 0.6.5 and 0.5.15, when Net::IMAP#id is called with a hash argument, although the ID field value strings are correctly quoted (escaping quoted specials), they were not validated to prohibit CRLF sequences. While Net::IMAP#enable does process its arguments for aliases, it does not validate them as valid atoms (or as a list of valid atoms). The #to_s value is sent verbatim. Arguments to either command could be used by an attacker to inject arbitrary IMAP commands. This vulnerability is fixed in 0.6.5 and 0.5.15.
Which versions are affected by CVE-2026-47242?
4 open source packages ship an affected version, including net-imap.
| Package | Affected | Fixed in |
|---|---|---|
net-imap RubyGems | All versions | 0.5.15 |
net-imap RubyGems | All versions | 0.5.15 |
net-imap RubyGems | From 0.6.0 | 0.6.4.1 |
net-imap RubyGems | From 0.6.0 | 0.6.4.1 |
Linux distribution packages (36)
ruby Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-bundled-gems Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-bundled-gems-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-debugsource Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-default-gems Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-devel Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-doc Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-libs Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
ruby-libs-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.3.12-11.el10_0.3 |
rubygem-bigdecimal Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.1.5-11.el10_0.3 |
rubygem-bigdecimal-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.1.5-11.el10_0.3 |
rubygem-bundler Red Hat:enterprise_linux_eus:10.0 | All versions | 0:2.5.22-11.el10_0.3 |
rubygem-io-console Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.7.1-11.el10_0.3 |
rubygem-io-console-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.7.1-11.el10_0.3 |
rubygem-irb Red Hat:enterprise_linux_eus:10.0 | All versions | 0:1.13.1-11.el10_0.3 |
rubygem-json Red Hat:enterprise_linux_eus:10.0 | All versions | 0:2.7.2-11.el10_0.3 |
rubygem-json-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:2.7.2-11.el10_0.3 |
rubygem-minitest Red Hat:enterprise_linux_eus:10.0 | All versions | 0:5.20.0-11.el10_0.3 |
rubygem-power_assert Red Hat:enterprise_linux_eus:10.0 | All versions | 0:2.0.3-11.el10_0.3 |
rubygem-psych Red Hat:enterprise_linux_eus:10.0 | All versions | 0:5.1.2-11.el10_0.3 |
rubygem-psych-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:5.1.2-11.el10_0.3 |
rubygem-racc Red Hat:enterprise_linux_eus:10.0 | All versions | 0:1.7.3-11.el10_0.3 |
rubygem-racc-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:1.7.3-11.el10_0.3 |
rubygem-rake Red Hat:enterprise_linux_eus:10.0 | All versions | 0:13.1.0-11.el10_0.3 |
rubygem-rbs Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.4.0-11.el10_0.3 |
rubygem-rbs-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.4.0-11.el10_0.3 |
rubygem-rdoc Red Hat:enterprise_linux_eus:10.0 | All versions | 0:6.6.3.1-11.el10_0.3 |
rubygem-rexml Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.4.4-11.el10_0.3 |
rubygem-rss Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.3.1-11.el10_0.3 |
rubygem-test-unit Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.6.1-11.el10_0.3 |
rubygem-typeprof Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.21.9-11.el10_0.3 |
rubygems Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.5.22-11.el10_0.3 |
rubygems-devel Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.5.22-11.el10_0.3 |
ruby Red Hat:rhel_e4s:9.4::appstream | All versions | 0:3.3.12-7.module+el9.4.0+24628+a370c2b9.2 |
ruby-bundled-gems Red Hat:rhel_e4s:9.4::appstream | All versions | 0:3.3.12-7.module+el9.4.0+24628+a370c2b9.2 |
How do I fix CVE-2026-47242?
Upgrade net-imap to a fixed version for your release line: 0.5.15 or 0.6.4.1.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-47242 being exploited?
There is no known exploitation of CVE-2026-47242 in the wild and no public exploit code.
Sources
Also known as ALPINE-CVE-2026-47242, AZL-91284, BELL-CVE-2026-47242, CLEANSTART-2026-FP14746, CLEANSTART-2026-YF80791, DEBIAN-CVE-2026-47242 and 21 more.