# CVE-2026-42246: Ruby Net::IMAP STARTTLS stripping vulnerability

Source: https://junglewise.ai/threats/cve-2026-42246-ruby-net-imap-starttls-stripping-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-09. Updated: 2026-05-18  
License: CC BY 4.0 with a link back

CVE-2026-42246 · Severity: high · CVSS 7.4 · Published 2026-05-09

A security flaw in the Ruby Net::IMAP library, which handles email communication for Ruby applications, allows attackers to bypass encryption. By intercepting the connection, an attacker can trick the application into believing a secure connection has been established when it is actually sending data in plain text. This could lead to the theft of sensitive email content or login credentials.

Technologies: [net-imap (RubyGems)](https://junglewise.ai/threats/technologies/net-imap). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2026-42246 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-42246 being exploited in the wild.

**How severe is CVE-2026-42246?** High severity, with a CVSS score of 7.4, published 9 May 2026.

**Which products and versions are affected?** net-imap (RubyGems) ECOSYSTEM:introduced=0.6.0,fixed=0.6.4.

**Is there a fix for CVE-2026-42246?** Yes. net-imap (RubyGems): upgrade to 0.6.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-42246 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-42246?** Check whether you run net-imap (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- net-imap (RubyGems): upgrade to 0.6.4 or later

  ```sh
  bundle update net-imap
  ```


## Technical details

A STARTTLS stripping vulnerability exists in the Ruby Net::IMAP library. The root cause is an improper check for unusual or exceptional conditions during the TLS handshake negotiation, specifically within the Net::IMAP#starttls method. A man-in-the-middle (MITM) attacker can intercept the communication and manipulate the server's response to make the client believe encryption was successfully initiated while the connection remains in plaintext. This allows the attacker to read or modify sensitive IMAP traffic. The issue is patched in versions 0.3.10, 0.4.24, 0.5.14, and 0.6.4.

## Affected products

- Ruby Net::IMAP < 0.3.10, 0.4.0 - 0.4.23, 0.5.0 - 0.5.13, 0.6.0 - 0.6.3

## Identifiers

- CVE-2026-42246
- GHSA-vcgp-9326-pqcp

## Timeline

- 2026-05-09: advisory: Initial disclosure by GitHub, Inc.
- 2026-04-23: patched: Patched versions released.

## References

- [https://github.com/ruby/net-imap/commit/0ede4c40b1523dfeaf95777b2678e54cc0fd9618](https://github.com/ruby/net-imap/commit/0ede4c40b1523dfeaf95777b2678e54cc0fd9618)
- [https://github.com/ruby/net-imap/commit/24a4e770b43230286a05aa2a9746cdbb3eb8485e](https://github.com/ruby/net-imap/commit/24a4e770b43230286a05aa2a9746cdbb3eb8485e)
- [https://github.com/ruby/net-imap/commit/97e2488fb5401a1783bddd959dde007d9fbce42c](https://github.com/ruby/net-imap/commit/97e2488fb5401a1783bddd959dde007d9fbce42c)
- [https://github.com/ruby/net-imap/commit/f79d35bf5833f186e81044c57c843eda30c873da](https://github.com/ruby/net-imap/commit/f79d35bf5833f186e81044c57c843eda30c873da)
- [https://github.com/ruby/net-imap/releases/tag/v0.3.10](https://github.com/ruby/net-imap/releases/tag/v0.3.10)
- [https://github.com/ruby/net-imap/releases/tag/v0.4.24](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.5.14)

## Related threats

- [Ruby Net::IMAP command injection in ID and ENABLE commands](https://junglewise.ai/threats/cve-2026-47242-ruby-net-imap-command-injection-in-id-and-enable-commands)
- [Ruby Net::IMAP denial of service via incomplete raw argument validation](https://junglewise.ai/threats/cve-2026-47241-ruby-net-imap-denial-of-service-via-incomplete-raw-argument)
- [Ruby Net::IMAP command injection via non-synchronizing literals](https://junglewise.ai/threats/cve-2026-47240-ruby-net-imap-command-injection-via-non-synchronizing-literals)
- [Ruby Net::IMAP command injection via Symbol arguments](https://junglewise.ai/threats/cve-2026-42258-ruby-net-imap-command-injection-via-symbol-arguments)
- [Ruby Net::IMAP command injection in multiple commands](https://junglewise.ai/threats/cve-2026-42257-ruby-net-imap-command-injection-in-multiple-commands)
