CVE-2026-42246 — Vulnerability in net-imap — CVE Details
net-imap vulnerable to STARTTLS stripping via invalid response timing
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.40%). Schedule for your next planned update.
Does your project use an affected net-imap version?
Paste your Gemfile.lock to check it for CVE-2026-42246 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
A man-in-the-middle attacker can cause Net::IMAP#starttls to return "successfully", without starting TLS.
Details
When using Net::IMAP#starttls to upgrade a plaintext connection to use TLS, a man-in-the-middle attacker can inject a tagged OK response with an easily predictable tag. By sending the response before the client finishes sending the command, the command completes "successfully" before the response handler is registered. This allows #starttls to return without error, but the response handler is never invoked, the TLS connection is never established, and the socket remains unencrypted.
This allows man-in-the-middle attackers to perform a STARTTLS stripping attack, unless the client code explicitly checks Net::IMAP#tls_verified?.
Impact
TLS bypass, leading to cleartext transmission of sensitive information.
Mitigation
- Upgrade to a patched version of net-imap that raises an exception whenever
#starttlsdoes not establish TLS. - Connect to an implicit TLS port, rather than use
STARTTLSwith a cleartext port. This is strongly recommended anyway:- RFC 8314: Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and Access
- NO STARTTLS: Why TLS is better without STARTTLS, A Security Analysis of STARTTLS in the Email Context
- Explicitly verify
Net::IMAP#tls_verified?istrue, before using the connection after#starttls.
Advisory Timeline
- First published May 4, 2026 (206 days ago).
- Last revised September 10, 2026 — 128 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install net-imap -v 0.4.24
gem install net-imap -v 0.5.14
gem install net-imap -v 0.6.4
gem install net-imap -v 0.3.10
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (4)
Affects 1 ecosystem: RubyGems (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-392
- CWE-393
- CWE-636
- CWE-754
- CWE-841
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.7 score means for each attack dimension.
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
References
- https://github.com/ruby/net-imap/security/advisories/GHSA-vcgp-9326-pqcpWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-42246ADVISORY
- https://github.com/ruby/net-imap/commit/0ede4c40b1523dfeaf95777b2678e54cc0fd9618WEB
- https://github.com/ruby/net-imap/commit/24a4e770b43230286a05aa2a9746cdbb3eb8485eWEB
- https://github.com/ruby/net-imap/commit/97e2488fb5401a1783bddd959dde007d9fbce42cWEB
- https://github.com/ruby/net-imap/commit/f79d35bf5833f186e81044c57c843eda30c873daWEB
- https://github.com/ruby/net-imapPACKAGE
- https://github.com/ruby/net-imap/releases/tag/v0.3.10WEB
- https://github.com/ruby/net-imap/releases/tag/v0.4.24WEB
- https://github.com/ruby/net-imap/releases/tag/v0.5.14WEB
- https://github.com/ruby/net-imap/releases/tag/v0.6.4WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2026-42246.ymlWEB
- https://nostarttls.secvuln.infoWEB
- https://www.rfc-editor.org/info/rfc8314WEB
Frequently Asked Questions
- What is CVE-2026-42246?
- net-imap vulnerable to STARTTLS stripping via invalid response timing. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.7/10).
- How do I check if my project is affected by CVE-2026-42246?
- CVE-2026-42246 affects net-imap. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42246 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 25.4% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-47242MEDIUM
Net::IMAP: Command Injection via ID command argument
- CVE-2026-42258MEDIUM
net-imap vulnerable to command Injection via unvalidated Symbol inputs
- CVE-2025-25186MEDIUM
Possible DoS by memory exhaustion in net-imap
- CVE-2026-42256MEDIUM
net-imap vulnerable to denial of service via high iteration count for `SCRAM-*` authentication
- CVE-2026-47240MEDIUM
Net::IMAP: Command Injection via non-synchronizing literal in "raw" argument
- CVE-2026-42257MEDIUM
net-imap vulnerable to command Injection via "raw" arguments to multiple commands
- CVE-2025-43857MEDIUM
net-imap rubygem vulnerable to possible DoS by memory exhaustion
- CVE-2026-42245LOW
net-imap has quadratic complexity when reading response literals