CVE-2026-42246: Net imap Net-imap Vulnerable To STARTTLS Stripping Vulnerability
HIGHCVE-2026-42246 is a HIGH net-imap vulnerable to starttls stripping vulnerability (CWE-841: Improper Enforcement of Behavioral Workflow) affecting Net imap libraries in the RubyGems ecosystem. The issue involves net-imap vulnerable to starttls stripping via invalid response timing. Remediation is available by upgrading affected packages to version 0.6.4, 0.5.14, 0.4.24, 0.3.10.
CVE-2026-42246 at a Glance
How to Fix CVE-2026-42246
To remediate this vulnerability, upgrade all affected Net imap dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade net-imap to 0.6.4
Upgrade net-imap to 0.5.14
Upgrade net-imap to 0.4.24
Upgrade net-imap to 0.3.10
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for net-imap
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-42246, inspect your project dependencies for Net imap:
inspect dependencies for net-imap
Analyze the terminal output to locate any version of Net imap in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-841: Improper Enforcement of Behavioral Workflow, where the product supports a session in which more than one behavior must be performed by an actor, but it does not properly ensure that the actor performs the behaviors in the required sequence. In Net imap, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42246 Affected Net imap Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
net-imap
|
RubyGems |
≥ 0.6.0
< 0.6.4
|
0.6.4
|
|
net-imap
|
RubyGems |
≥ 0.5.0
< 0.5.14
|
0.5.14
|
|
net-imap
|
RubyGems |
≥ 0.4.0
< 0.4.24
|
0.4.24
|
|
net-imap
|
RubyGems |
< 0.3.10
|
0.3.10
|
References
Frequently Asked Questions
What is CVE-2026-42246?
Which Net imap versions are affected?
What version fixes CVE-2026-42246?
Is net-imap affected?
What CWE is associated with CVE-2026-42246?
How can I check RubyGems dependencies for CVE-2026-42246?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vcgp-9326-pqcp",
"modified" : "2026-05-14T20:48:01Z",
"published" : "2026-05-04T22:01:52Z",
"aliases" : [ "CVE-2026-42246" ],
"summary" : "net-imap vulnerable to STARTTLS stripping via invalid response timing",
"details" : "### Summary\n\nA man-in-the-middle attacker can cause `Net::IMAP#starttls` to return \"successfully\", without starting TLS.\n\n### Details\n\nWhen 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.\n\nThis allows man-in-the-middle attackers to perform a STARTTLS stripping attack, unless the client code explicitly checks `Net::IMAP#tls_verified?`.\n\n### Impact\n\nTLS bypass, leading to cleartext transmission of sensitive information.\n\n### Mitigation\n\n* Upgrade to a patched version of net-imap that raises an exception whenever `#starttls` does not establish TLS.\n* Connect to an implicit TLS port, rather than use `STARTTLS` with a cleartext port.\n This is strongly recommended anyway:\n * [RFC 8314](https://www.rfc-editor.org/info/rfc8314): Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and Access\n * [NO STARTTLS](https://nostarttls.secvuln.info/): Why TLS is better without STARTTLS, A Security Analysis of STARTTLS in the Email Context\n* Explicitly verify `Net::IMAP#tls_verified?` is `true`, before using the connection after `#starttls`.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "net-imap"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.6.0"
}, {
"fixed" : "0.6.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.6.3"
}
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "net-imap"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.5.0"
}, {
"fixed" : "0.5.14"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.5.13"
}
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "net-imap"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.4.0"
}, {
"fixed" : "0.4.24"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.4.23"
}
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "net-imap"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.3.10"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.3.9"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/security/advisories/GHSA-vcgp-9326-pqcp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42246"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/commit/0ede4c40b1523dfeaf95777b2678e54cc0fd9618"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/commit/24a4e770b43230286a05aa2a9746cdbb3eb8485e"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/commit/97e2488fb5401a1783bddd959dde007d9fbce42c"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/commit/f79d35bf5833f186e81044c57c843eda30c873da"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ruby/net-imap"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/releases/tag/v0.3.10"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/releases/tag/v0.4.24"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/releases/tag/v0.5.14"
}, {
"type" : "WEB",
"url" : "https://github.com/ruby/net-imap/releases/tag/v0.6.4"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2026-42246.yml"
}, {
"type" : "WEB",
"url" : "https://nostarttls.secvuln.info"
}, {
"type" : "WEB",
"url" : "https://www.rfc-editor.org/info/rfc8314"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-392", "CWE-393", "CWE-636", "CWE-754", "CWE-841" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-04T22:01:52Z",
"nvd_published_at" : "2026-05-09T20:16:28Z"
}
}