net-imap: Command Injection via "raw" arguments to multiple commands
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- None · High · Low
- Fix status
- Partial Red Hat: 5 fixed, 1 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-77.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| ruby | net-imap | before 0.4.24; 0.5.0 to before 0.5.14; 0.6.0 to before 0.6.4 | 0.4.24, 0.5.14, 0.6.4 | Patch available | CNA |
| — | net-imap (RubyGems) | 0.6.0 to before 0.6.4 | 0.6.4 | Patch available | GHSA-hm49-wcqc-g2xg |
| — | net-imap (RubyGems) | 0.5.0 to before 0.5.14 | 0.5.14 | Patch available | GHSA-hm49-wcqc-g2xg |
| — | net-imap (RubyGems) | before 0.4.24 | 0.4.24 | Patch available | GHSA-hm49-wcqc-g2xg |
- net-imap Vendorruby Affected before 0.4.24; 0.5.0 to before 0.5.14; 0.6.0 to before 0.6.4 Fixed in 0.4.24, 0.5.14, 0.6.4 Patch available CNA
- net-imap (RubyGems) Vendor— Affected 0.6.0 to before 0.6.4 Fixed in 0.6.4 Patch available GHSA-hm49-wcqc-g2xg
- net-imap (RubyGems) Vendor— Affected 0.5.0 to before 0.5.14 Fixed in 0.5.14 Patch available GHSA-hm49-wcqc-g2xg
- net-imap (RubyGems) Vendor— Affected before 0.4.24 Fixed in 0.4.24 Patch available GHSA-hm49-wcqc-g2xg
Remediation
- Fix · CNA net-imap (ruby) Fixed in 0.4.24, 0.5.14, 0.6.4
- Fix · GHSA-hm49-wcqc-g2xg net-imap (RubyGems) Fixed in 0.6.4 Advisory →
- Fix · GHSA-hm49-wcqc-g2xg net-imap (RubyGems) Fixed in 0.5.14 Advisory →
- Fix · GHSA-hm49-wcqc-g2xg net-imap (RubyGems) Fixed in 0.4.24 Advisory →
Red Hat 8 advisories
- RHSA-2026:50827 Released 2026-08-05 · Red Hat rating Importantruby:4.0 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 9) ruby-4.0.6-34.module+el9.8.0+24564+e55418dc.aarch64::ruby:4.0, ruby-4.0.6-34.module+el9.8.0+24564+e55418dc.i686::ruby:4.0, ruby-4.0.6-34.module+el9.8.0+24564+e55418dc.ppc64le::ruby:4.0 +47
- RHSA-2026:50828 Released 2026-08-05 · Red Hat rating Importantruby:3.3 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 9) ruby-3.3.12-8.module+el9.8.0+24568+2bbebe96.aarch64::ruby:3.3, ruby-3.3.12-8.module+el9.8.0+24568+2bbebe96.i686::ruby:3.3, ruby-3.3.12-8.module+el9.8.0+24568+2bbebe96.ppc64le::ruby:3.3 +47
- RHSA-2026:50778 Released 2026-08-05 · Red Hat rating Importantruby security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 10) ruby-3.3.12-14.el10_2, ruby-bundled-gems-3.3.12-14.el10_2, ruby-default-gems-3.3.12-14.el10_2 +20
- Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) ruby-doc-3.3.12-14.el10_2
Show 5 more Red Hat advisories
- RHSA-2026:50773 Released 2026-08-05 · Red Hat rating Importantruby4.0 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 10) ruby4.0-4.0.6-36.el10_2, ruby4.0-devel-4.0.6-36.el10_2, ruby4.0-rubygem-mysql2-0.5.7-36.el10_2 +1
- Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) ruby4.0-doc-4.0.6-36.el10_2
- RHSA-2026:50728 Released 2026-08-05 · Red Hat rating Importantruby:3.3 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 8) ruby-3.3.12-8.module+el8.10.0+24567+c4e5368e.aarch64::ruby:3.3, ruby-3.3.12-8.module+el8.10.0+24567+c4e5368e.i686::ruby:3.3, ruby-3.3.12-8.module+el8.10.0+24567+c4e5368e.ppc64le::ruby:3.3 +47
- RHSA-2026:40380 Released 2026-07-15 · Red Hat rating ImportantRed Hat Hardened Images RPMs Security Update
- Red Hat Hardened Images ruby3.3-3.3.10-23.4.hum1@aarch64, ruby3.3-3.3.10-23.4.hum1@src, ruby3.3-3.3.10-23.4.hum1@x86_64 +46
- RHSA-2026:38694 Released 2026-07-13 · Red Hat rating ImportantRed Hat Hardened Images RPMs Security Update
- Red Hat Hardened Images ruby3.4-3.4.10-31.hum1@aarch64, ruby3.4-3.4.10-31.hum1@src, ruby3.4-3.4.10-31.hum1@x86_64 +46
- RHSA-2026:36978 Released 2026-07-09 · Red Hat rating ImportantRed Hat Hardened Images RPMs bug fix and enhancement update
- Red Hat Hardened Images ruby4.0-4.0.5-35.hum1@aarch64, ruby4.0-4.0.5-35.hum1@src, ruby4.0-4.0.5-35.hum1@x86_64 +10
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat 3scale API Management Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux AppStream (v. 10) | Fixed | RHSA-2026:50773, RHSA-2026:50778 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2026:50728 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2026:50827, RHSA-2026:50828 |
| Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) | Fixed | RHSA-2026:50773, RHSA-2026:50778 |
| Red Hat Hardened Images | Fixed | RHSA-2026:36978, RHSA-2026:38694, RHSA-2026:40380 |
Not affected: 1 product
- Red Hat Hardened Images
Timeline
- 2026-10-02 Threatist record created from CVE-2026-42257
- 2026-10-03 Alias added: GHSA-hm49-wcqc-g2xg
- 2026-11-06 Affected versions changed · Red Hat
References
Advisory 2
Other 10
- https://github.com/ruby/net-imap/releases/tag/v0.4.24
- https://github.com/ruby/net-imap/releases/tag/v0.5.14
- https://github.com/ruby/net-imap/releases/tag/v0.6.4
- 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
- https://github.com/ruby/net-imap
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2026-42257.yml
More ruby Net vulnerabilities
- TI-2026-30563 net-imap vulnerable to STARTTLS stripping via invalid response timing CVSS 4.0HIGH 7.6
- TI-2026-30574 net-imap: Command Injection via unvalidated Symbol inputs CVSS 4.0MEDIUM 5.8
- TI-2026-30572 net-imap: Denial of service via high iteration count for `SCRAM-*` authentication CVSS 4.0MEDIUM 6.0
- TI-2025-28441 net-imap rubygem vulnerable to possible DoS by memory exhaustion CVSS 4.0MEDIUM 6.0
- TI-2026-30562 net-imap: Quadratic complexity when reading response literals CVSS 4.0LOW 2.3
Sources
- CVE-2026-42257 · CVE Program
- CVE-2026-42257 · NVD
- FIRST EPSS
- GHSA-hm49-wcqc-g2xg · GitHub Advisory Database · CC BY 4.0
- CVE-2026-42257 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences