[CVE-2026-42246] Pin net-imap 0.3.10 - #457
Merged
Jan-Kazlouski-elastic merged 3 commits intoJul 24, 2026
Merged
Conversation
JRuby 9.4.12.0 ships vulnerable default net-imap 0.2.3 (STARTTLS stripping). Pin the lowest fixed release and remove the default gem from Docker images so scanners and runtime both use 0.3.10. Part of elastic/security#12735
Contributor
Author
Scanner A/B (
|
| Tool | Before | After |
|---|---|---|
| Trivy | reported | clear |
| Snyk | reported (SNYK-RUBY-NETIMAP-16420230) | clear |
Jan-Kazlouski-elastic
requested review from
artem-shelkovnikov,
erikcurrin-elastic and
mattnowzari
July 23, 2026 18:38
The default gem removal missed the older stdlib copy (/opt/jruby/lib/ruby/stdlib/net/imap.rb, net-imap 0.1.1), which still contains the vulnerable #starttls and is within the CVE-2026-42246 affected range (< 0.3.10). Remove it too so no vulnerable IMAP code remains in the images; the app loads the pinned 0.3.10 gem via Bundler. Part of elastic/security#12735
Jan-Kazlouski-elastic
force-pushed
the
jan-kazlouski/12735-cve-2026-42246-fix
branch
from
July 23, 2026 19:00
8a2758a to
e90f688
Compare
Jan-Kazlouski-elastic
enabled auto-merge (squash)
July 24, 2026 14:17
Resolve NOTICE.txt conflict by regenerating it (make notice) on top of the merged Gemfile.lock, which now includes both erb 4.0.4.1 (#456) and net-imap 0.3.10.
erikcurrin-elastic
approved these changes
Jul 24, 2026
Jan-Kazlouski-elastic
added a commit
that referenced
this pull request
Jul 27, 2026
Backports the following commits to 1.0: - [CVE-2026-42246] Pin net-imap 0.3.10 (#457) Co-authored-by: Jan-Kazlouski-elastic <jan.kazlouski@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of https://github.com/elastic/security/issues/12735
Resolves CVE-2026-42246 (high) — STARTTLS stripping / response injection in
Net::IMAP#starttls. Fixed in net-imap 0.3.10.JRuby 9.4.12.0 ships vulnerable net-imap in two places: the default gem 0.2.3 and an older stdlib copy 0.1.1 (
net/imap.rb). The crawler does not use IMAP; this change removes both from the images and pins the fixed gem so scanners and runtime use 0.3.10.Changes
Gemfile/Gemfile.lock: pinnet-imap0.3.10(lowest fixed release) so Bundler installs over the JRuby default gem.Dockerfile/Dockerfile.wolfi: remove the defaultnet-imap0.2.3 gem artifacts and the older stdlibnet/imap.rb(0.1.1) from/opt/jruby.NOTICE.txt: regenerated for the new gems (make notice); added adatelicense-file fallback.Testing
0.3.10(vendor/bundle/.../net-imap-0.3.10).*imap*files under/opt/jruby, and the app still loads 0.3.10 viabundler/setup.Scanner A/B (
CVE-2026-42246)Checklists
Pre-Review Checklist
crawler.yml.exampleandelasticsearch.yml.example)v0.1.0)make noticeif any dependencies have been addedChanges Requiring Extra Attention
Release Note
Pin net-imap to 0.3.10 to resolve CVE-2026-42246 (STARTTLS stripping in Net::IMAP).