Skip to main content

CVE-2026-42246 — Vulnerability in net-imap — CVE Details

HIGH

net-imap vulnerable to STARTTLS stripping via invalid response timing

Published May 4, 2026Updated September 10, 2026Source: OSV

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.

Check my Gemfile.lock

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 #starttls does not establish TLS.
  • Connect to an implicit TLS port, rather than use STARTTLS with 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? is true, 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.

Bundler
Update net-imap to 0.4.24 or later
gem install net-imap -v 0.4.24
Bundler
Update net-imap to 0.5.14 or later
gem install net-imap -v 0.5.14
Bundler
Update net-imap to 0.6.4 or later
gem install net-imap -v 0.6.4
Bundler
Update net-imap to 0.3.10 or later
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).

PackageFixed In
net-imap RubyGems · Affected: 0.4.0, 0.4.1, 0.4.10, 0.4.11 (+21 more)0.4.24
net-imap RubyGems · Affected: 0.5.0, 0.5.1, 0.5.10, 0.5.11 (+10 more)0.5.14
net-imap RubyGems · Affected: 0.6.0, 0.6.1, 0.6.2, 0.6.30.6.4
net-imap RubyGems · Affected: 0.1.0, 0.1.1, 0.2.0, 0.2.1 (+15 more)0.3.10

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.7 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
P
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

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

CVSS Score
7.7

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.40%
EPSS percentile: 25.4

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

GHSA-vcgp-9326-pqcp

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock