CVE-2026-42246
High · 7.4CVSS
7.4
EPSS
0.3%
Published
May 9, 2026
CISA due date
—
Cloudanix analysis
Some Ruby email applications may think their connection is encrypted when it is not, allowing someone on the network to steal or alter email data.
- Exploitation
- Adjacent Network
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Library
- Class
- Cryptographic Weakness
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
This vulnerability affects Ruby applications using the Net::IMAP library to establish encrypted IMAP sessions with STARTTLS. In vulnerable versions prior to 0.3.10, 0.4.24, 0.5.14, and 0.6.4, a network-positioned man-in-the-middle attacker can interfere with the STARTTLS negotiation so that Net::IMAP#starttls reports success even though TLS was not actually started. As a result, the application may continue sending IMAP credentials, mailbox contents, message metadata, or mail operations over an unencrypted connection while believing the session is protected. The issue primarily impacts confidentiality and integrity of IMAP traffic; it does not directly provide code execution or server compromise.
Why it matters to the business
Organizations using affected Ruby Net::IMAP versions may unknowingly expose email credentials and mailbox data when applications connect to IMAP servers across untrusted or interceptable networks. Successful exploitation could allow theft of application mail account credentials, reading or manipulation of email content, collection of password reset messages or business communications, and follow-on account compromise. The EPSS score is currently low and there is no known CISA KEV listing or reported ransomware association, but the issue is still operationally important where Ruby applications process sensitive email or authenticate to external mail services.
How an attack unfolds
An attacker must be able to observe and modify network traffic between a vulnerable Ruby application and its IMAP server, such as through a hostile Wi-Fi network, compromised network device, malicious proxy, DNS or routing manipulation, or other man-in-the-middle position. The application opens an IMAP connection and calls Net::IMAP#starttls expecting to upgrade the plaintext session to TLS. The attacker tampers with the STARTTLS exchange in a way that causes the vulnerable library method to return successfully without actually negotiating TLS. Believing encryption is active, the application continues with authentication and mailbox operations. The attacker can then capture credentials and IMAP data in cleartext and may also modify traffic in transit, depending on application behavior and server-side protections.
How to fix it
Upgrade the Ruby Net::IMAP package to a patched version matching the branch in use: 0.3.10 or later, 0.4.24 or later, 0.5.14 or later, or 0.6.4 or later. Review Gemfile.lock, dependency manifests, vendored gems, and container images to ensure the patched net-imap version is actually deployed. Prefer implicit TLS on port 993 where supported, or ensure STARTTLS failures are treated as hard failures and never fall back to plaintext authentication. Enforce certificate validation, hostname verification, and trusted CA configuration for IMAP TLS connections. As a compensating control until upgrade is complete, restrict outbound IMAP connections to trusted networks or known mail server endpoints, block plaintext IMAP where possible, and monitor for IMAP sessions that authenticate without TLS.
How to confirm the fix worked
Confirm the deployed application resolves net-imap to a fixed version by checking dependency lockfiles and runtime package inventory. In Ruby environments, verify the installed gem version with package tooling such as `bundle info net-imap`, `bundle exec ruby -r net/imap -e 'puts Gem.loaded_specs["net-imap"].version'`, or equivalent software composition analysis. Exercise IMAP connection paths in a test environment and confirm STARTTLS results in an actual TLS session before credentials are sent. Use packet capture or TLS-aware network inspection in a controlled test to verify that authentication commands such as LOGIN, AUTHENTICATE, SELECT, FETCH, and message data are not visible in plaintext after STARTTLS. Confirm applications fail closed if TLS negotiation is interrupted, stripped, or returns an unexpected server response.
Typical attack path
- Gain a man-in-the-middle position between the Ruby application and the IMAP server.
- Wait for or induce the application to initiate an IMAP session using Net::IMAP and STARTTLS.
- Tamper with the STARTTLS negotiation so the vulnerable Net::IMAP#starttls call reports success without enabling TLS.
- Allow the application to continue authentication and mailbox activity over the downgraded plaintext session.
- Capture IMAP credentials, message contents, metadata, or session commands, and optionally alter IMAP traffic in transit.
How to detect it
Because this is a protocol downgrade issue rather than a payload with a stable signature, exploitation may leave few host artifacts. Focus detection on network telemetry, mail server logs, proxy/firewall logs, DNS/routing anomalies, and application logs around IMAP connection establishment. Look for IMAP sessions on port 143 where STARTTLS was attempted but no TLS handshake followed, or where authentication commands were observed before encryption was established. Review packet captures for plaintext IMAP commands such as LOGIN, AUTHENTICATE, SELECT, FETCH, APPEND, or STORE after a STARTTLS command. On mail servers, compare successful authentications with TLS/session metadata and flag logins that were not protected by TLS or show inconsistent TLS state. Investigate unusual source networks, unexpected proxies, ARP/DNS/routing changes, certificate validation warnings, repeated STARTTLS failures followed by successful authentication, and mail access patterns inconsistent with normal application behavior. If sensitive accounts may have authenticated during suspected downgrade conditions, treat credentials as potentially exposed.
What your security team should do
- Inventory Ruby applications, services, jobs, and scripts that use Net::IMAP or the net-imap gem, especially those connecting to external IMAP servers.
- Prioritize upgrades for systems that process sensitive email, password reset mailboxes, customer communications, or privileged operational mail accounts.
- Upgrade net-imap to 0.3.10, 0.4.24, 0.5.14, 0.6.4, or later as appropriate for the branch in use, then rebuild and redeploy affected containers or packages.
- Rotate IMAP credentials for high-value accounts if plaintext exposure is suspected or if applications have operated over untrusted networks while vulnerable.
- Prefer IMAPS on port 993 or enforce fail-closed STARTTLS behavior with strict certificate and hostname validation.
- Review network controls to prevent applications from authenticating to IMAP servers over plaintext or through untrusted proxies.
- Add regression tests that simulate failed or tampered STARTTLS negotiation and verify the application does not proceed with authentication.
- Search historical logs and packet captures, where available, for IMAP authentication or mailbox commands occurring without an established TLS session.
The record
Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.3.10, 0.4.24, 0.5.14, and 0.6.4, a man-in-the-middle attacker can cause Net::IMAP#starttls to return "successfully", without starting TLS. This issue has been patched in versions 0.3.10, 0.4.24, 0.5.14, and 0.6.4.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-20005 Multiple Cisco products are affected by a vulnerability in the Snort 3 Detection Engine… CWE-392
- CVE-2024-12797 Issue summary: Clients using RFC7250 Raw Public Keys (RPKs) to authenticate a server may… CWE-392
- CVE-2026-9058 Szafir SDK returns a success status code from the cryptographic digital signature… CWE-393
- CVE-2025-24531 In OpenSC pam_pkcs11 before 0.6.13, pam_sm_authenticate() wrongly returns PAM_IGNORE in… CWE-393
- CVE-2026-88831 BusyBox httpd IP deny rules with invalid CIDR prefix lengths fail open, leaving a parsed… CWE-636
- CVE-2026-81379 Not failing securely ('failing open') in Visual Studio Code allows an unauthorized… CWE-636
- CVE-2026-85649 (Holloway) Chew, Kean Ho's Actualizer v1.2.0 and earlier contains a fail-open password… CWE-636
- CVE-2026-18329 Description NGINX JavaScript (njs) and QuickJS (qjs) engines have a vulnerability when a… CWE-636