Skip to content

Fix CVE-2026-42246: upgrade Ruby net-imap gem to >=0.6.4#1066

Merged
dpark01 merged 3 commits into
mainfrom
dp/fix-cve-2026-42246-net-imap
May 11, 2026
Merged

Fix CVE-2026-42246: upgrade Ruby net-imap gem to >=0.6.4#1066
dpark01 merged 3 commits into
mainfrom
dp/fix-cve-2026-42246-net-imap

Conversation

@dpark01
Copy link
Copy Markdown
Member

@dpark01 dpark01 commented May 11, 2026

Fixes #1065

Changes

Applies the established gem-fixup pattern (remove old default gem, install patched version) to net-imap in three Dockerfiles:

  • docker/Dockerfile.assemble
  • docker/Dockerfile.phylo
  • docker/Dockerfile.mega

Each file now removes the vulnerable net-imap 0.6.2 default gem and installs >=0.6.4 inline in the same RUN layer (so the vulnerable files never appear in a committed layer).

Vulnerability Background

CVE-2026-42246: STARTTLS-stripping vulnerability where a MITM can cause Net::IMAP#starttls to return successfully without TLS being negotiated (CVSS 4.0 score 7.6 HIGH).

The gem enters via the mummer4 -> yaggo -> ruby transitive chain — the same chain that introduced CVE-2026-33210 (json) and CVE-2026-41316 (erb).

Practical exploitability is near-zero (no IMAP connections are made in our pipelines), but the Rego policy correctly surfaces it because it has AV:N + VC:H + VI:H (network-accessible with high confidentiality and integrity impact).

Testing

CI will:

  • Build all three images on amd64 and arm64 (native runners, no emulation)
  • Run unit tests (no functional change — this is a gem replacement)
  • Re-scan images via container-scan.yml (CVE-2026-42246 should no longer appear)

Authored by Claude Sonnet 4.5 via Claude Code. Copilot review feedback addressed in commit 7455255.

Applies the established gem-fixup pattern to net-imap in the assemble,
phylo, and mega images. The gem enters via mummer4 -> yaggo -> ruby
(same chain that introduced the json and erb CVEs). Practical
exploitability is near-zero (no IMAP connections are made), but the
Rego policy correctly surfaces it due to AV:N + VC:H + VI:H.

Closes #1065
Copilot AI review requested due to automatic review settings May 11, 2026 13:16
@dpark01 dpark01 enabled auto-merge May 11, 2026 13:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to remediate CVE-2026-42246 by applying the repository’s established “default gem fixup” pattern to Ruby’s net-imap within the container build, across the assemble, phylo, and mega Docker images.

Changes:

  • Document net-imap as an additional post-install CVE fixup alongside existing json / erb fixups.
  • Add removal + reinstall steps for net-imap (installing net-imap >= 0.6.4) in each Dockerfile’s existing “fixups” RUN layer.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
docker/Dockerfile.assemble Adds net-imap fixup steps (remove old gem artifacts, install >=0.6.4) during conda dependency install layer.
docker/Dockerfile.phylo Adds net-imap fixup steps (remove old gem artifacts, install >=0.6.4) during conda dependency install layer.
docker/Dockerfile.mega Adds net-imap fixup steps (remove old gem artifacts, install >=0.6.4) during conda dependency install layer.

Comment thread docker/Dockerfile.assemble Outdated
Comment thread docker/Dockerfile.assemble Outdated
Comment thread docker/Dockerfile.phylo Outdated
Comment thread docker/Dockerfile.phylo Outdated
Comment thread docker/Dockerfile.mega Outdated
Comment thread docker/Dockerfile.mega Outdated
@dpark01 dpark01 disabled auto-merge May 11, 2026 13:20
- Change -maxdepth 3 to -maxdepth 4 (net-imap gemspec is at depth 4)
- Change specifications/default/ to specifications/ (net-imap is a regular gem, not a default gem)

The original pattern was copied from json/erb fixes but net-imap has
a different gem structure.
@dpark01
Copy link
Copy Markdown
Member Author

dpark01 commented May 11, 2026

Thanks @copilot-pull-request-reviewer for catching those issues! Fixed in 7455255:

  1. Depth issue: Changed -maxdepth 3 to -maxdepth 4. The gemspec is at /opt/conda/lib/ruby/gems/4.0.0/specifications/net-imap-0.6.2.gemspec which is 4 levels deep from the find starting point.

  2. Gemspec path issue: Changed specifications/default/ to specifications/. Unlike the typical default gem pattern, net-imap is installed as a regular gem in the specifications directory, not in the default/ subdirectory.

Verified these paths by inspecting the current main-assemble image.

- Add pre-pull step to scan-containers job to avoid transient GHCR errors
- Update actions/checkout v4→v5 (31 occurrences)
- Update actions/upload-artifact v4→v6 (2 occurrences)
- Update docker/login-action v3→v4 (6 occurrences)
- Update docker/setup-buildx-action v3→v4 (1 occurrence)
- Update github/codeql-action/upload-sarif v3→v4 (1 occurrence)
- Pin aquasecurity/trivy-action master→v0.36.0 (4 occurrences)

All changes address GitHub's Node.js 20→24 forced migration (June 2, 2026)
and improve scan reliability + supply chain security.
@dpark01 dpark01 merged commit 546c3b8 into main May 11, 2026
82 of 83 checks passed
@dpark01 dpark01 deleted the dp/fix-cve-2026-42246-net-imap branch May 11, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CVE-2026-42246] net-imap: STARTTLS stripping via invalid response timing

2 participants