CVE-2026-42246
JSON

7.6high

net-imap vulnerable to STARTTLS stripping via invalid response timing

Severity
7.6high CVSS:4.0 by GitHub_M
Exploit likelihood
0.31% (higher than 26% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-vcgp-9326-pqcp

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.

Affected

Product or packageVersionsReported by
ruby net-imap< 0.3.10, >= 0.4.0, < 0.4.24, >= 0.5.0, < 0.5.14, >= 0.6.0, < 0.6.4CVE List
ruby4.0Not specified
Not affected: from 0:4.0.3-35.el10_2 before *
CVE List
rubyNot specified
Not affected: from 0:3.3.10-13.el10_2 before *, from 0:3.3.10-11.el10_0.2 before *, from 0:2.0.0.648-39.el7_9.1 before *, from 0:3.0.7-167.el9_8 before *, from 0:3.0.4-161.el9_2.3 before *, from 0:3.0.7-162.el9_4.3 before *
CVE List
ruby:2.5Not specified
Not affected: from 8100020260615131019.489197e6 before *, from 8040020260630124058.522a0ee4 before *, from 8060020260630123825.ad008a3a before *, from 8080020260625114827.63b34585 before *
CVE List
ruby:3.3Not specified
Not affected: from 8100020260615131010.489197e6 before *, from 9080020260615131001.9 before *, from 9040020260630065449.9 before *, from 9060020260630075016.9 before *
CVE List
ruby:4.0Not specified
Not affected: from 9080020260619130154.9 before *
CVE List
ruby4-0-mainNot specified
Not affected: from 4.0.0-33.4.hum1 before *
CVE List
ruby3-4-mainNot specified
Not affected: from 3.4.10-31.hum1 before *, from 3.4.8-31.2.hum1 before *
CVE List
ruby3-3-mainNot specified
Not affected: from 3.3.10-23.2.hum1 before *
CVE List
3scale-amp21/systemNot specifiedCVE List
3scale-amp21/zyncNot specifiedCVE List
3scale-amp22/systemNot specifiedCVE List

All scores

GitHub_M7.6high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
redhat-SADP7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
NVD7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Classification

CWE-325CWE-392CWE-393CWE-636CWE-754CWE-841

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database
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.
NVD (es)

Net::IMAP implementa la funcionalidad de cliente del Protocolo de Acceso a Mensajes de Internet (IMAP) en Ruby. Antes de las versiones 0.3.10, 0.4.24, 0.5.14 y 0.6.4, un atacante man-in-the-middle puede hacer que Net::IMAP#starttls devuelva 'satisfactoriamente', sin iniciar TLS. Este problema ha sido parcheado en las versiones 0.3.10, 0.4.24, 0.5.14 y 0.6.4.

References

https://github.com/ruby/net-imap/security/advisories/GHSA-vcgp-9326-pqcpmitigation, vendor-advisory, web
https://github.com/ruby/net-imap/commit/0ede4c40b1523dfeaf95777b2678e54cc0fd9618patch, web
https://github.com/ruby/net-imap/commit/24a4e770b43230286a05aa2a9746cdbb3eb8485epatch, web
https://github.com/ruby/net-imap/commit/97e2488fb5401a1783bddd959dde007d9fbce42cpatch, web
https://github.com/ruby/net-imap/commit/f79d35bf5833f186e81044c57c843eda30c873dapatch, web
https://github.com/ruby/net-imap/releases/tag/v0.3.10release-notes, web
https://github.com/ruby/net-imap/releases/tag/v0.4.24release-notes, web
https://github.com/ruby/net-imap/releases/tag/v0.5.14release-notes, web
https://access.redhat.com/security/cve/CVE-2026-42246vdb-entry
https://bugzilla.redhat.com/show_bug.cgi?id=2468499issue-tracking
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42246.json
https://access.redhat.com/errata/RHSA-2026:37397vendor-advisory

Sources

SourceRecordLicence
CVE ListCVE-2026-42246 changed 2026-08-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-vcgp-9326-pqcp changed 2026-09-10CC-BY-4.0
NVDCVE-2026-42246 changed 2026-08-24Public domain