☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Ruby logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 7.4 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N 🐛 CWE-392
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2026-42246

CVE-2026-42246 Supply Chain Attack in Ruby-Lang
📅 PUBLISHED: 2026-05-09 20:16 UTC 🔄 UPDATED: 2026-10-02 19:31 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.40%
👁️
0.40% probability
9.9× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: Japan License: Open Source
Affected: Net\ — upgrade to patched release
CVSS VECTOR BREAKDOWN 7.4
AV: N Attack Vector Network
AC: H Attack Complexity High
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: N Availability None
7.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2026-42246 is a critical Man-in-the-Middle (MitM) vulnerability in the Ruby Net::IMAP library. The flaw allows an attacker to force the starttls command to return a success status without actually establishing a TLS session. This effectively downgrades the connection to plaintext, enabling an attacker to intercept, read, and modify all IMAP traffic, including credentials and email content. The vulnerability affects all versions prior to the patched releases (0.3.10, 0.4.24, 0.5.14, and 0.6.4). The EPSS score is 0.0%, indicating low exploitation probability in the wild at this time, but the technical impact is severe.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability resides in the Ruby net-imap gem, a core component of the Ruby standard library. Organizations using Ruby for email processing, especially in CI/CD pipelines, background job processors (e.g., Sidekiq), or any application that connects to IMAP servers, are at risk. The supply chain risk is high because the gem is widely used and the vulnerability can be silently exploited without triggering typical security alerts. Patching the gem in all environments, including development, staging, and production, is critical.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
  • Base Score: 7.4 (High)
  • Attack Vector (AV): Network (N) – The attack is performed over the network.
  • Attack Complexity (AC): High (H) – The attacker must be in a position to perform a Man-in-the-Middle attack.
  • Privileges Required (PR): None (N) – No authentication needed.
  • User Interaction (UI): None (N) – No user action required.
  • Scope (S): Unchanged (U) – The vulnerable component and the attacker are in the same security authority.
  • Confidentiality (C): High (H) – Full disclosure of email content and credentials.
  • Integrity (I): High (H) – Attacker can modify email data in transit.
  • Availability (A): None (N) – No direct impact on availability.

Threat Level: High. While the attack complexity is high, the impact on confidentiality and integrity is severe. A successful MitM attack can lead to complete compromise of email accounts and sensitive data.

Deep Dive & Mechanics

The Net::IMAP#starttls method is designed to upgrade a plaintext IMAP connection to a TLS-encrypted one. The vulnerability lies in the method's failure to properly verify that the TLS handshake was actually completed. An attacker performing a MitM attack can intercept the STARTTLS command and respond with a fake success message, causing the client to believe the connection is secure when it is not.

Attack Flow:

  1. The client connects to the IMAP server on port 143 (plaintext).
  2. The client sends the STARTTLS command.
  3. The attacker, positioned between the client and server, intercepts this command.
  4. The attacker sends a forged OK response to the client, simulating a successful TLS upgrade.
  5. The client's Net::IMAP#starttls method returns true without actually performing the TLS handshake.
  6. All subsequent communication (including login credentials and email data) is transmitted in plaintext and can be captured by the attacker.

Root Cause: The starttls method does not validate the TLS handshake completion. It relies solely on the server's response to the STARTTLS command, which can be easily spoofed by an attacker.

Vulnerable vs. Patched Code

Vulnerable Code (Conceptual):

def starttls(options = {})
  send_command("STARTTLS")
  # No verification that TLS handshake actually occurred
  true
end

Patched Code (Conceptual):

def starttls(options = {})
  send_command("STARTTLS")
  # Verify TLS handshake completion
  raise "TLS handshake failed" unless tls_established?
  true
end

The patched version includes a check (e.g., tls_established?) that verifies the TLS session is active before returning success. This prevents the MitM downgrade attack.

Exploitation & Lab Setup

Red Team (Attacker)

Prerequisites:

  • Network access to intercept traffic between the victim and the IMAP server (e.g., ARP spoofing, rogue Wi-Fi, or compromised router).
  • A tool to perform MitM attacks (e.g., bettercap, mitmproxy, or custom Python script).

Lab Setup:

  1. Victim Machine: Ruby application using Net::IMAP (vulnerable version) to connect to an IMAP server.
  2. Attacker Machine: Kali Linux with bettercap installed.
  3. IMAP Server: A test IMAP server (e.g., Dovecot) running on a separate machine.

Exploitation Steps:

  1. ARP Spoofing: Use bettercap to poison the ARP cache of the victim and the IMAP server.
    sudo bettercap -eval "set arp.spoof.targets 192.168.1.100; arp.spoof on"
    
  2. Intercept and Modify Traffic: Use mitmproxy to intercept the IMAP traffic and modify the STARTTLS response.
    # mitmproxy script to spoof STARTTLS response
    from mitmproxy import http
    
    def response(flow: http.HTTPFlow) -> None:
        if "STARTTLS" in flow.request.pretty_url:
            flow.response = http.Response.make(
                200,
                b"OK Begin TLS negotiation now",
                {"Content-Type": "text/plain"}
            )
    
  3. Capture Credentials: After the downgrade, capture the plaintext IMAP login credentials using Wireshark or tcpdump.

Blue Team (Defender)

Detection:

  • Monitor for unexpected STARTTLS responses without subsequent TLS handshake.
  • Use network monitoring tools to detect plaintext IMAP traffic on port 143 after a STARTTLS command.

Mitigation:

  • Immediately update the net-imap gem to the patched version.
  • Enforce TLS-only connections by disabling plaintext IMAP on the server.
  • Implement network segmentation to limit MitM attack vectors.

Indicators of Compromise (IOCs)

  • Network Traffic:
    • IMAP traffic on port 143 after a STARTTLS command that does not transition to TLS.
    • Unexpected OK responses to STARTTLS without subsequent TLS handshake.
  • Logs:
    • IMAP server logs showing STARTTLS commands followed by plaintext authentication.
    • Client logs showing successful starttls but no TLS session established.
  • File System:
    • Presence of MitM tools (e.g., bettercap, mitmproxy) on the network.
  • Processes:
    • Unusual network sniffing processes (e.g., tcpdump, wireshark).

Detection Engineering

YARA Rule

rule Detect_CVE_2026_42246_Exploit {
   meta:
      description = "Detects potential exploitation of CVE-2026-42246 by identifying plaintext IMAP traffic after STARTTLS"
      author = "Valters IT"
      date = "2026-01-01"
      reference = "CVE-2026-42246"
   strings:
      $starttls = "STARTTLS" nocase
      $ok_response = "OK Begin TLS negotiation now" nocase
      $plaintext_auth = /LOGIN\s+\S+\s+\S+/ nocase
   condition:
      $starttls and $ok_response and $plaintext_auth
}

Sigma Rule

title: Detection of CVE-2026-42246 Exploitation
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects plaintext IMAP authentication after a STARTTLS command, indicating a potential MitM downgrade attack.
author: Valters IT
date: 2026/01/01
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2026-42246
logsource:
    category: network_connection
    product: suricata
detection:
    selection:
        app_protocol: imap
        event_type: alert
        alert.signature_id: 202642246
    condition: selection
falsepositives:
    - Legitimate IMAP servers that do not support TLS
level: high

Suricata Rule

alert tcp any any -> any 143 (msg:"CVE-2026-42246 - Potential MitM Downgrade Attack on IMAP STARTTLS"; flow:to_server,established; content:"STARTTLS"; nocase; content:"OK Begin TLS negotiation now"; nocase; distance:0; within:100; sid:202642246; rev:1;)

Remediation & Mitigation

  1. Immediate Patching: Update the net-imap gem to version 0.3.10, 0.4.24, 0.5.14, or 0.6.4 (depending on your Ruby version).
    gem update net-imap
    
  2. Enforce TLS: Configure your IMAP server to require TLS for all connections and disable plaintext authentication.
  3. Network Segmentation: Isolate email servers and clients on separate VLANs to reduce the risk of MitM attacks.
  4. Monitor Traffic: Deploy network monitoring tools to detect plaintext IMAP traffic and anomalous STARTTLS responses.
  5. User Education: Train users to avoid connecting to untrusted networks when accessing email.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2026-42246/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.