Skip to content

fix(security): patched ruby, node.js, ca-certificates and npm audit fixes (2026-10) - #1263

Merged
takaokouji merged 5 commits into
developfrom
security/runtime-and-deps-2026-10
Oct 30, 2026
Merged

takaokouji merged 5 commits into
developfrom
security/runtime-and-deps-2026-10

Conversation

@smalruby3-editor-bot

@smalruby3-editor-bot smalruby3-editor-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Summary

2026-10 のセキュリティ対応です。

  1. Ruby の正規表現の脆弱性: ruby-lang.org の告知(2026-10-23)。CVE-2026-89078 / 93577 / 97229 / 110264 で、修正版は 4.0.9 / 3.4.12 / 3.3.13。
  2. eMudhra の中間 CA 鍵の漏えい: 8 つの中間 CA の秘密鍵が推測可能だった。ブラウザは対応済みだが、OS や言語ランタイムの証明書ストアは更新が要る。
    • Debian 12 は ca-certificates 20250419~deb12u2(DLA-4845-1)で修正。
    • Node.js は 22.23.4 / 24.22.1 / 26.12.1 のセキュリティリリースで対応。
  3. npm 依存の既知の脆弱性: 互換性を壊さずに直せる分だけ直す。

Changes Made

ランタイム・OS イメージ・CI(コミット 1)

  • Node.js を 24.22.1 に固定: .nvmrc、packages/scratch-media-lib-scripts/.nvmrc、infra/*/.node-version(6 つ)。CI はこれらを読む。
    • 以前は 24.15.0 と 24.8.0 だった。
    • 24.22.2 は公開から 72 時間未満なので使わない(3 日ルール)。
  • Ruby
    • mesh-v2 は 3.4.12(.ruby-version と infra/Dockerfile)。
    • smalruby3 gem は 4.0.9(.ruby-version)。
  • ruby/setup-ruby を v1.335.0 に更新。
    • 以前の v1.332.0 は修正版の Ruby を知らないので、gem の CI 行列(3.3 / 3.4 / 4.0)が脆弱な版に解決されていた。
    • 修正版を知る最初の版は v1.334.0。
  • Docker イメージ(Dockerfile、infra/Dockerfile、ruby/smalruby3/Dockerfile)
    • ビルド時に ca-certificates・Node.js・Ruby のバージョンを検査し、修正前ならビルドを止める。
    • キャッシュに残った古いベースイメージで作り直しても気付けるようにするため。
    • ベースイメージのタグは今のまま(node:24-bookworm-slim / ruby:3.3-slim-bookworm)。
  • ruby/smalruby3/Dockerfile で ca-certificates を明示的に入れる(ベースイメージより新しい版に上がる)。

npm 依存(コミット 2)

  • npm audit fix --package-lock-only --before 2026-10-27 を、ルートと infra の 6 プロジェクトに実行。
    • CI と同じ npm 11.19.1(Node.js 24.22.1 に同梱)を使った。
    • semver の範囲内の更新だけで、package.json は変えていない。
    • 共有の node_modules を書き換えないよう、lock ファイルだけを更新した。
    • 変わった 212 版すべてについて、公開から 72 時間以上たっていることをレジストリで確認した(3 日ルール)。
  • ルート: critical 11 → 7、high 51 → 31
  • infra(各プロジェクト): critical 1 → 0。残る high 4 件は aws-cdk-lib に同梱された依存で、CDK の更新が要る(security: remaining npm advisories that need major upgrades or replacements (2026-10) #1264)。

CI のランナー(コミット 5)

  • ci-cd / test-packages / gem 系(ci-ruby / release-gem / gem-build-check の Linux)のジョブを、ubuntu-24.04 に固定した。
  • ubuntu-latest が 26.04 になり、2 つの問題が起きていたため。
    • npm ci の playwright-chromium が「Playwright does not support chromium on ubuntu26.04-x64」で失敗する。develop ではキャッシュが当たって隠れていたが、lock か .nvmrc を変える PR はすべて落ちる。
    • gem のネイティブ拡張のコンパイルが失敗する(develop でも失敗していた)。

レビューで人間に判断してほしいこと

敵対的レビューの全指摘と対応は、PR のコメントにまとめた。

  • Q1: workbox 7.4.1 の推移的な更新で、本番ビルドの rollup が 2 → 4 系になる。個人が保守するフォークのプレリリース版プラグイン(@trickfilm400/rollup-plugin-off-main-thread@3.0.0-pre1)が入る。
  • Q2: react-intl-redux@2.4.1 が peer 依存として自動で入る(害は無い)。
  • Q3: Lambda の実行環境は AWS 側の更新待ち(未確認)。

対象外にしたもの(#1264 で判断)

  • メジャー更新が要る依存、修正版が無い依存(skyway-js、query-string、decode-uri-component)、aws-cdk-lib の更新。
  • AWS Lambda の実行環境(Node.js 22 / Ruby 3.4)
    • AWS が管理していて、CDK で更新方式を指定していないので、自動で更新される。
    • 外部入力から正規表現を組み立てるコードは、mesh-v2 の Lambda にも smalruby3 gem の lib にも無い。
  • GitHub Actions のランナー: GitHub が管理しているイメージ。

マージ後に人間がすること

  • devcontainer を作り直す。いまの開発コンテナは ca-certificates 20230311+deb12u1、Node.js 24.18.0 で、どちらも修正前。
  • Docker のイメージを手元で使っている場合は、--pull --no-cache で作り直す。

Test Coverage

  • Docker のビルド時検査のコマンドを、開発コンテナ上で実行して確認した。
    • 古い ca-certificates(20230311+deb12u1)と古い Node(24.18.0)で止まる。
    • Node の判定は 24.22.0 で止まり、24.22.1 / 24.23.0 / 25.0.0 で通る。
  • Docker のビルドそのものはコンテナに docker が無いので未確認。
  • 依存の更新は CI(unit / integration / infra)で確認する。

🤖 Generated with Claude Code

smalruby3-editor-bot Bot and others added 2 commits October 30, 2026 13:41
Ruby 4.0.9 / 3.4.12 / 3.3.13 fix the Regexp CVEs published on
2026-10-23 (CVE-2026-89078, CVE-2026-93577, CVE-2026-97229,
CVE-2026-110264). Node.js 24.22.1 and Debian 12 ca-certificates
20250419~deb12u2 drop the roots behind the compromised eMudhra
intermediate CAs.

- pin Node.js 24.22.1 in .nvmrc and every infra .node-version
- pin Ruby 3.4.12 for mesh-v2 (CI and infra image) and 4.0.9 for
  the smalruby3 gem
- bump ruby/setup-ruby to v1.335.0, the first release that knows the
  patched Rubies (the old pin resolved 3.3/3.4/4.0 to vulnerable ones)
- fail Docker builds whose base image still carries the old
  ca-certificates, Node.js or Ruby

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run npm audit fix --package-lock-only for the root workspace and every
infra project. Only versions inside the existing semver ranges move;
no package.json changes.

- root: 11 critical / 51 high -> 7 critical / 31 high
- infra (each project): 1 critical -> 0; the 4 remaining highs are
  bundled inside aws-cdk-lib and need a separate cdk upgrade

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@smalruby3-editor-bot smalruby3-editor-bot Bot added the 👥 human-review-required Bot 権限外パスを含む PR。本人以外の人間レビュー必須 label Oct 30, 2026
smalruby3-editor-bot Bot and others added 3 commits October 30, 2026 13:54
…hten guards

Review findings on the first round:

- regenerate every lockfile with npm 11.19.1 (the npm bundled with
  Node.js 24.22.1 in CI) and --before 2026-10-27, so no version newer
  than 72 hours enters the tree; the audit counts are unchanged
- docker guards: require Debian 12 for the ca-certificates check, fail
  on any Node.js major other than 24, and check Ruby per release series
- refresh the stale ruby version note in .claude/rules/ruby/smalruby3.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ubuntu-latest moved to Ubuntu 26.04, where the playwright-chromium
postinstall fails ("Playwright does not support chromium on
ubuntu26.04-x64"). develop hid this behind the node_modules cache;
any change to .nvmrc or package-lock.json misses the cache and fails.
The smalruby3 gem jobs fail to compile on 26.04 as well (also on
develop), so keep them on 24.04 too. Drop the temporary npm ci
diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

@smalruby3-editor-bot

Copy link
Copy Markdown
Author

🔍 敵対的レビュー(round 1・独立したレビュアーによる): 指摘 14 件(Must 1 / Question 3 / FYI 10)

Must

  • [M1] npm audit fix が、修正に関係ない依存まで公開から 72 時間未満の最新版に上げていた(53 件。prod の Lambda に入る @aws-sdk/xml-builder@3.972.42 を含む)。3 日ルールの例外は「セキュリティ修正のため」で、無関係な依存を新しくする理由にはならない。 — 修正済み(0346f2e646)。CI と同じ npm 11.19.1 と --before 2026-10-27 で全 lock を作り直した。変わった 212 版すべての公開日時をレジストリで照合し、72 時間未満は 0 件。脆弱性の件数は変わらない。

Question(人間の判断待ち)

  • [Q1] workbox-webpack-plugin / workbox-build 7.4.0 → 7.4.1 の推移的な更新で、本番ビルド(Service Worker の生成)の rollup が 2 → 4 系になる。さらに @surma/rollup-plugin-off-main-thread が @trickfilm400/rollup-plugin-off-main-thread@3.0.0-pre1 に置き換わる。これは個人が保守するフォークのプレリリース版で、workbox 7.4.1 本体が依存している。CI の本番ビルド(build-and-deploy)は通った。このフォークを本番ビルドに入れてよいか判断がほしい。だめなら workbox を 7.4.0 に固定し、その分の audit 修正(serialize-javascript ほか)をあきらめる。
  • [Q2] react-intl-redux@2.4.1 が root に追加される。scratch-paint の満たされていない peer 依存を、新しい npm が自動で入れるもの(2024 年の版で、実際には参照されていない)。害は無いが、監査とは関係ない差分。
  • [Q3] Lambda の実行環境(Node.js 22 / Ruby 3.4)は AWS 管理で、更新方式は既定の Auto。Node 22 の修正版(22.23.4)が AWS 側で適用済みかは、本番の読み取りが要るので未確認。

FYI(対応)

  • [FYI1] Docker のビルド時検査に抜け道があった(Debian 13 で古い ca-certificates が通る、Node 24 以外の系列が通る、Ruby 3.4.0〜3.4.11 が通る)。 — 修正済み(0346f2e646)。Debian 12 であることを確かめ、Node は 24 系以外なら止め、Ruby は系列ごとに見る。
  • [FYI2] キャッシュの古いイメージで作り直すと検査で止まり、エラーメッセージも分かりにくかった。 — エラーメッセージに rebuild with --pull を足した。devcontainer の作り直しは PR 本文に記載した。
  • [FYI3] node:24-bookworm-slim は追従するタグで、Docker のイメージと CI の Node が一致しないことがある(PR 以前から)。 — 対応なし。
  • [FYI4] setup-ruby の固定(v1.335.0)は正しく、古い SHA の残りも無い。 — 確認のみ。
  • [FYI5] gem-build-check.yml は oxidize-rb 経由で、固定されていない ruby/setup-ruby-pkgs@v1 を使う(PR 以前から)。 — 対応なし。
  • [FYI6] ci-infra.yml のコメントで、ubuntu-24.04 に固定する理由が消えていた。 — 新しいコメントで理由を書いた。
  • [FYI7] Node.js のリリースノートには eMudhra の名前が直接は無い(root store を NSS 3.131.1 に更新)。 — 対応なし。
  • [FYI8] audit の件数は主張どおり。 — 確認のみ。
  • [FYI9] 新しいインストールスクリプトや、npm 以外の取得元は増えていない。 — 確認のみ。
  • [FYI10] .claude/rules/ruby/smalruby3.md の Ruby のバージョンの記述が古かった。 — 修正済み。

CI で見つかった別の問題(対応済み)

GitHub の ubuntu-latest が Ubuntu 26.04 に変わり、2 つの問題が起きていた。

  • npm ci の途中で playwright-chromium が Playwright does not support chromium on ubuntu26.04-x64 で失敗する。develop ではキャッシュが当たって隠れていたが、lock か .nvmrc を変える PR はすべて落ちる。
  • smalruby3 gem のネイティブ拡張のコンパイルが、develop でも失敗していた。

npm と gem のジョブを ubuntu-24.04 に固定し(8dc8c95c87)、CI は全部通った。

@smalruby3-editor-bot

Copy link
Copy Markdown
Author

Q1 / Q3 の確認結果

Q1: rollup 4 と fork のプラグイン(不正なリリースではない)

  • rollup@4.65.1
    • 公開は 2026-10-26 11:00 UTC(4 日前)。
    • rollup の GitHub Actions から OIDC で公開されている(npm provenance attestation と署名あり)。
    • GitHub Advisory DB の rollup の勧告は 2 件で、どちらも 4.65.1 は対象外。
      • GHSA-mw96-cpmx-2vgc(パストラバーサルによる任意ファイル書き込み、high): 4.59.0 で修正。
      • GHSA-gcx4-mw62-g8wm(DOM Clobbering による XSS、high): 4.22.4 で修正。
    • 今の develop は rollup 2.80.0。この PR で 4 系に上がることは、むしろ修正版への更新になる。
    • マルウェア勧告(type=malware)は 0 件。
  • @trickfilm400/rollup-plugin-off-main-thread@3.0.0-pre1
    • 依存元は workbox-build 7.4.1。この依存は Google 側の workbox メンテナが公開したリリースで指定されている。
    • tarball を取り出し、元の @surma/rollup-plugin-off-main-thread@2.2.3 と比べた。
      • 改行コード以外の差分は、パッケージ名・URL・依存の版上げ(ejs ^3.1.10 など)・devDependencies だけ。
      • index.js と loader.ejs のロジックは同一。
    • install 系のスクリプト(preinstall / install / postinstall)は無い。
    • 公開は 2025-12 で、勧告も 0 件。
  • 結論: どちらも不正なリリースではない。

Q3: eMudhra の中間 CA が影響するか(Lambda の外向き TLS)

Node.js の fetch / https は OS ではなく Node 同梱の CA ストアを使う。各 Lambda が TLS でつなぐ先は次のとおり。

Lambda AWS 以外の接続先
classroom Google(google-auth-library の公開鍵取得、classroom.googleapis.com)、Microsoft の JWKS(login.microsoftonline.com)、api.anthropic.com
admin Google(google-auth-library)
bug-report Google、Microsoft の JWKS
rubytee-relay api.anthropic.com
smalruby-api api.scratch.mit.edu、translate-service.scratch.mit.edu、drive.google.com、cors-proxy(利用者が指定した任意の URL)
mesh-v2(Ruby) DynamoDB だけ(AWS)
  • AWS への通信(DynamoDB / S3 / Secrets Manager)は Amazon の CA なので、影響しない。
  • AWS 以外への通信は、悪用されるとすれば AWS から相手までの経路に攻撃者が入り、漏えいした中間 CA で偽の証明書を作った場合。
    • 理屈の上で影響が一番大きいのは、Microsoft の JWKS や Google の公開鍵を偽装されてトークン検証を突破されること。
    • ただし、AWS 内部と大手事業者の間の経路に入り込むのは非現実的なので、リスクは低い。
  • cors-proxy はもともと http: も許可しているので、CA の問題で新しく増えるリスクは無い。
  • 結論: AWS の自動更新待ちで問題ない。

🤖 Generated with Claude Code

@takaokouji
takaokouji merged commit 0302588 into develop Oct 30, 2026
37 checks passed
@takaokouji
takaokouji deleted the security/runtime-and-deps-2026-10 branch October 30, 2026 15:25
github-actions Bot pushed a commit that referenced this pull request Oct 30, 2026
…time-and-deps-2026-10

fix(security): patched ruby, node.js, ca-certificates and npm audit fixes (2026-10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👥 human-review-required Bot 権限外パスを含む PR。本人以外の人間レビュー必須

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant