fix(deps): Rails を 8.0.5.1 に更新 (CVE-2026-66066) - #1858
Merged
Conversation
Active Storage の variant 処理に任意ファイル読み取り・リモートコード実行の 脆弱性 (CVE-2026-66066) が報告され、activestorage 8.0.5.1 で修正された。 本サイトは以下の理由で成立条件を満たさず実質的な影響はないが、多層防御として パッチ版へ更新する。 - ruby-vips / image_processing に依存していないため libvips に到達しない - active_storage_* テーブルが存在しない - has_one_attached とファイルアップロード経路がない Gemfile の制約は ~> 8.0.0 のため変更不要。bundle update --conservative rails で Rails 一式のみを更新した (241 examples, 0 failures)。 https://discuss.rubyonrails.org/t/cve-2026-66066-possible-arbitrary-file-read-and-remote-code-execution-in-active-storage-variant-processing/91432
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.
概要
Active Storage の variant 処理に、任意ファイル読み取りおよびリモートコード実行の脆弱性 CVE-2026-66066 が報告されました。修正版の Rails 8.0.5.1 へ更新します。
< 7.2.3.2/>= 8.0, < 8.0.5.1/>= 8.1, < 8.1.3.1variant_processor = :vips)かつ ② 信頼できないユーザーからの画像アップロードを許可本サイトへの影響:実質的になし(多層防御としての更新)
更新前のバージョンは 8.0.4.1 で影響範囲内でしたが、成立条件は以下の3つの独立した理由で満たされません。
ruby-vips/image_processing/mini_magickgit log -Sによる全履歴検索でも導入歴なし)active_storage_*テーブルdb/migrate/の Active Storage 系はrails app:update由来でreturn unless table_exists?ガード付きの no-op)has_one_attached/has_many_attachedfile_field/multipart/params[:file]のいずれも無しconfig.load_defaults 8.0によりvariant_processorの既定値は:vipsですが、ruby-vips が依存に含まれないため libvips に到達する手段がありません。また Blob レコードを保存するテーブルが存在しないため、アップロードの第一段階が成立しません。アプリ内で
ActiveStorageに言及している唯一の箇所はapp/models/document.rbのActiveStorage::Filename#sanitized(ファイル名の文字列正規化)で、本件とは無関係です。以上より、advisory が推奨する
secret_key_base等のシークレットのローテーションは、露出期間が過去にも存在しないため不要と判断しています。変更内容
Gemfileの制約は~> 8.0.0のため変更不要で、bundle update --conservative railsにより Rails 一式のみを 8.0.4.1 → 8.0.5.1 に更新しました。Gemfile.lockの差分はバージョン番号と、上流 gemspec 側で緩和されたminitestの制約のみです。動作確認
補足(本 PR には含めていません)
require "rails/all"により Active Storage のルート(POST /rails/active_storage/direct_uploadsなど9本)が公開されています。テーブルが無いため悪用には至りませんが、使用していないためconfig.active_storage.draw_routes = falseによる攻撃面の削減は別途検討の余地があります。本 CVE とは独立した変更のため、この PR には含めていません。