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 package | Versions | Reported by |
|---|---|---|
| ruby net-imap | < 0.3.10, >= 0.4.0, < 0.4.24, >= 0.5.0, < 0.5.14, >= 0.6.0, < 0.6.4 | CVE List |
| ruby4.0 | Not specified Not affected: from 0:4.0.3-35.el10_2 before * | CVE List |
| ruby | Not 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.5 | Not specified Not affected: from 8100020260615131019.489197e6 before *, from 8040020260630124058.522a0ee4 before *, from 8060020260630123825.ad008a3a before *, from 8080020260625114827.63b34585 before * | CVE List |
| ruby:3.3 | Not specified Not affected: from 8100020260615131010.489197e6 before *, from 9080020260615131001.9 before *, from 9040020260630065449.9 before *, from 9060020260630075016.9 before * | CVE List |
| ruby:4.0 | Not specified Not affected: from 9080020260619130154.9 before * | CVE List |
| ruby4-0-main | Not specified Not affected: from 4.0.0-33.4.hum1 before * | CVE List |
| ruby3-4-main | Not specified Not affected: from 3.4.10-31.hum1 before *, from 3.4.8-31.2.hum1 before * | CVE List |
| ruby3-3-main | Not specified Not affected: from 3.3.10-23.2.hum1 before * | CVE List |
| 3scale-amp21/system | Not specified | CVE List |
| 3scale-amp21/zync | Not specified | CVE List |
| 3scale-amp22/system | Not specified | CVE List |
| 3scale-amp22/zync | Not specified | CVE List |
| 3scale-amp2/system-rhel7 | Not specified | CVE List |
| 3scale-amp2/system-rhel8 | Not specified | CVE List |
| 3scale-amp2/system-rhel9 | Not specified | CVE List |
| 3scale-amp2/zync-rhel8 | Not specified | CVE List |
| 3scale-amp2/zync-rhel9 | Not specified | CVE List |
| openshift/ose-rhel-coreos-9 | Not specified | CVE List |
| net-imap (RubyGems) | from 0.6.0 before 0.6.4, from 0.5.0 before 0.5.14, from 0.4.0 before 0.4.24, before 0.3.10 | GitHub Advisory Database |
| ruby-lang net::imap | before 0.3.10, from 0.4.0 before 0.4.24, from 0.5.0 before 0.5.14, from 0.6.0 before 0.6.4 | NVD |
All scores
| GitHub_M | 7.6high CVSS:4.0 | 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 |
| redhat-SADP | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
| GitHub | high CVSS:4.0 | 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 |
| NVD | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
Classification
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
#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.
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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42246 changed 2026-08-24 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-vcgp-9326-pqcp changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-42246 changed 2026-08-24 | Public domain |