Command injection in net-imap - CVE-2026-42257

 

Command injection in net-imap - CVE-2026-42257

Published: November 9, 2026


Vulnerability identifier: #VU162937
CSH Severity: Medium
CVSS v4: 6.8 [CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N]
CVE-ID: CVE-2026-42257
CWE-ID: CWE-77
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows an unprivileged local attacker to execute arbitrary IMAP commands through an application's authenticated connection to a mail server.

The vulnerability exists due to missing validation and escaping of raw arguments in net-imap commands when an application passes unvalidated, user-controlled input to affected methods. An unprivileged local attacker can insert CRLF sequences into these arguments to inject additional commands, such as deleting mailboxes, during normal application use.


Affected software

net-imap
Debian Linux
Anolis OS
Ubuntu
openEuler
ruby2.3 (Ubuntu package)
libruby2.3 (Ubuntu package)
ruby2.5 (Ubuntu package)
libruby2.5 (Ubuntu package)
rubygem-net-telnet
rubygem-xmlrpc
rubygem-rss
rubygem-abrt
rubygem-abrt-doc
rubygem-io-console
rubygem-mysql2
rubygem-mysql2-doc
rubygem-typeprof
rubygem-power_assert
rubygem-did_you_mean
rubygem-bigdecimal
rubygem-pg
rubygem-pg-doc
rubygem-racc
rubygem-irb
rubygem-json
rubygem-openssl
ruby
ruby-help
ruby-irb
ruby-devel
ruby-debugsource
ruby-debuginfo
rubygem-bundler
rubygems
rubygems-devel
rubygem-psych
rubygem-test-unit
rubygem-rexml
ruby-libs
ruby-default-gems
ruby-doc
ruby-bundled-gems
rubygem-rbs
rubygem-minitest
rubygem-rdoc
rubygem-rake
ruby3.3 (Debian package)

How to mitigate CVE-2026-42257

Install security update from vendor's website.

net-imap - addressed in versions 0.4.24, 0.5.14, 0.6.4
ruby2.3 (Ubuntu package) - update to 2.3.1-2~ubuntu16.04.16+esm14
libruby2.3 (Ubuntu package) - update to 2.3.1-2~ubuntu16.04.16+esm14
ruby2.5 (Ubuntu package) - update to 2.5.1-1ubuntu1.16+esm8
libruby2.5 (Ubuntu package) - update to 2.5.1-1ubuntu1.16+esm8
rubygem-net-telnet - update to 0.1.1-138
rubygem-xmlrpc - update to 0.3.0-138
rubygem-rss - update to 0.3.1-8
rubygem-abrt - update to 0.4.0-1
rubygem-abrt-doc - update to 0.4.0-1
rubygem-io-console - update to 0.4.6-138
rubygem-mysql2 - update to 0.5.5-1
rubygem-mysql2-doc - update to 0.5.5-1
rubygem-io-console - update to 0.7.1-8
rubygem-typeprof - update to 0.21.9-8
rubygem-power_assert - update to 1.1.1-138
rubygem-did_you_mean - update to 1.2.0-138
rubygem-bigdecimal - update to 1.3.4-138
rubygem-pg - update to 1.5.4-1
rubygem-pg-doc - update to 1.5.4-1
rubygem-racc - update to 1.7.3-8
rubygem-irb - update to 1.13.1-8
rubygem-power_assert - update to 2.0.3-8
rubygem-json - update to 2.1.0-138
rubygem-openssl - update to 2.1.2-138
ruby - update to 2.5.8-138
ruby-help - update to 2.5.8-138
ruby-irb - update to 2.5.8-138
ruby-devel - update to 2.5.8-138
ruby-debugsource - update to 2.5.8-138
ruby-debuginfo - update to 2.5.8-138
rubygem-bundler - update to 2.5.22-8
rubygem-json - update to 2.7.2-8
rubygems - update to 2.7.6-138
rubygems-devel - update to 2.7.6-138
rubygem-psych - update to 3.0.2-138
rubygem-bigdecimal - update to 3.1.5-8
rubygem-test-unit - update to 3.2.7-138
rubygem-rexml - addressed in versions 3.3.9-8, 3.4.4-8
ruby-libs - addressed in versions 3.3.9-8, 3.3.12-8
ruby-default-gems - addressed in versions 3.3.9-8, 3.3.12-8
ruby-doc - addressed in versions 3.3.9-8, 3.3.12-8
ruby-devel - addressed in versions 3.3.9-8, 3.3.12-8
ruby-bundled-gems - addressed in versions 3.3.9-8, 3.3.12-8
ruby - addressed in versions 3.3.9-8, 3.3.12-8
rubygem-rbs - update to 3.4.0-8
rubygems - update to 3.5.22-8
rubygems-devel - update to 3.5.22-8
rubygem-test-unit - update to 3.6.1-8
rubygem-psych - update to 5.1.2-8
rubygem-minitest - update to 5.10.3-138
rubygem-minitest - update to 5.20.0-8
rubygem-rdoc - update to 6.0.1.1-138
rubygem-rdoc - update to 6.6.3.1-8
rubygem-rake - update to 12.3.0-138
rubygem-rake - update to 13.1.0-8
ruby3.3 (Debian package) - update to 3.3.13-0+deb13u1

External References

Related Security Bulletins