Loading...
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

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](https://www.rfc-editor.org/info/rfc8314): Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and Access * [NO STARTTLS](https://nostarttls.secvuln.info/): 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 (161 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, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
net-imap
rubygems
0.4.0, 0.4.1, 0.4.10, 0.4.11 (+21 more)0.4.24
net-imap
rubygems
0.5.0, 0.5.1, 0.5.10, 0.5.11 (+10 more)0.5.14
net-imap
rubygems
0.6.0, 0.6.1, 0.6.2, 0.6.30.6.4
net-imap
rubygems
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. 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

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-vcgp-9326-pqcp

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies