Skip to content

fix(deps): Rails を 8.0.5.1 に更新 (CVE-2026-66066) - #1858

Merged
yasulab merged 1 commit into
mainfrom
fix-cve-2026-66066-activestorage
Jul 30, 2026
Merged

fix(deps): Rails を 8.0.5.1 に更新 (CVE-2026-66066)#1858
yasulab merged 1 commit into
mainfrom
fix-cve-2026-66066-activestorage

Conversation

@yasulab

@yasulab yasulab commented Jul 30, 2026

Copy link
Copy Markdown
Member

概要

Active Storage の variant 処理に、任意ファイル読み取りおよびリモートコード実行の脆弱性 CVE-2026-66066 が報告されました。修正版の Rails 8.0.5.1 へ更新します。

  • 影響範囲: activestorage < 7.2.3.2 / >= 8.0, < 8.0.5.1 / >= 8.1, < 8.1.3.1
  • 成立条件: ① libvips を variant processor に使用(variant_processor = :vipsかつ ② 信頼できないユーザーからの画像アップロードを許可

本サイトへの影響:実質的になし(多層防御としての更新)

更新前のバージョンは 8.0.4.1 で影響範囲内でしたが、成立条件は以下の3つの独立した理由で満たされません。

確認項目 結果
ruby-vips / image_processing / mini_magick Gemfile.lock に無し(git log -S による全履歴検索でも導入歴なし)
active_storage_* テーブル schema.rb に無し(db/migrate/ の Active Storage 系は rails app:update 由来で return unless table_exists? ガード付きの no-op)
has_one_attached / has_many_attached 使用なし(全履歴でも使用歴なし)
ファイルアップロード経路 file_field / multipart / params[:file] のいずれも無し

config.load_defaults 8.0 により variant_processor の既定値は :vips ですが、ruby-vips が依存に含まれないため libvips に到達する手段がありません。また Blob レコードを保存するテーブルが存在しないため、アップロードの第一段階が成立しません。

アプリ内で ActiveStorage に言及している唯一の箇所は app/models/document.rbActiveStorage::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 の制約のみです。

動作確認

bundle exec rspec spec
# => 241 examples, 0 failures

補足(本 PR には含めていません)

require "rails/all" により Active Storage のルート(POST /rails/active_storage/direct_uploads など9本)が公開されています。テーブルが無いため悪用には至りませんが、使用していないため config.active_storage.draw_routes = false による攻撃面の削減は別途検討の余地があります。本 CVE とは独立した変更のため、この PR には含めていません。

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
@yasulab
yasulab merged commit 125e1f2 into main Jul 30, 2026
5 checks passed
@yasulab
yasulab deleted the fix-cve-2026-66066-activestorage branch July 30, 2026 05:34
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.

1 participant