GHSA-vcgp-9326-pqcp

Suggest an improvement
Source
https://github.com/advisories/GHSA-vcgp-9326-pqcp
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-vcgp-9326-pqcp/GHSA-vcgp-9326-pqcp.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-vcgp-9326-pqcp
Aliases
  • CVE-2026-42246
Downstream
Related
Published
2026-05-04T22:01:52Z
Modified
2026-05-05T20:14:24.538524684Z
Severity
  • 7.6 (High) CVSS_V4 - 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 CVSS Calculator
Summary
net-imap vulnerable to STARTTLS stripping via invalid response timing
Details

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.
Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-04T22:01:52Z",
    "cwe_ids": [
        "CWE-392",
        "CWE-393",
        "CWE-636",
        "CWE-754",
        "CWE-841"
    ],
    "severity": "HIGH",
    "nvd_published_at": null
}
References

Affected packages

RubyGems / net-imap

Package

Name
net-imap
Purl
pkg:gem/net-imap

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0.6.0
Fixed
0.6.4

Affected versions

0.*
0.6.0
0.6.1
0.6.2
0.6.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-vcgp-9326-pqcp/GHSA-vcgp-9326-pqcp.json"
last_known_affected_version_range
"<= 0.6.3"

RubyGems / net-imap

Package

Name
net-imap
Purl
pkg:gem/net-imap

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0.5.0
Fixed
0.5.14

Affected versions

0.*
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.5.7
0.5.8
0.5.9
0.5.10
0.5.11
0.5.12
0.5.13

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-vcgp-9326-pqcp/GHSA-vcgp-9326-pqcp.json"
last_known_affected_version_range
"<= 0.5.13"

RubyGems / net-imap

Package

Name
net-imap
Purl
pkg:gem/net-imap

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0.4.0
Fixed
0.4.24

Affected versions

0.*
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.4.5
0.4.6
0.4.7
0.4.8
0.4.9
0.4.9.1
0.4.10
0.4.11
0.4.12
0.4.13
0.4.14
0.4.15
0.4.16
0.4.17
0.4.18
0.4.19
0.4.20
0.4.21
0.4.22
0.4.23

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-vcgp-9326-pqcp/GHSA-vcgp-9326-pqcp.json"
last_known_affected_version_range
"<= 0.4.23"

RubyGems / net-imap

Package

Name
net-imap
Purl
pkg:gem/net-imap

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.3.10

Affected versions

0.*
0.1.0
0.1.1
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.2.5
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.4.1
0.3.5
0.3.6
0.3.7
0.3.8
0.3.9

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-vcgp-9326-pqcp/GHSA-vcgp-9326-pqcp.json"
last_known_affected_version_range
"<= 0.3.9"