ホーム>React>Reactの脆弱性(React2Shellほか)の影響範囲と、自分のアプリが対象か確かめる方法(npm ls・npm audit)
React

Reactの脆弱性(React2Shellほか)の影響範囲と、自分のアプリが対象か確かめる方法(npm ls・npm audit)

いつもご利用ありがとうございます。
この記事にはアフィリエイト広告を含む広告が掲載されており、その広告費によって運営しています。
Amazonのアソシエイトとして、ララテックは適格販売により収入を得ています。

2025年12月のReact2Shell(CVE-2025-55182)から2026年10月まで続いたReact Server Componentsの脆弱性を一覧にし、自分のアプリが対象かを確かめる手順をまとめました。Vite+Reactは対象外なこと、Next.jsはnpm lsに出ないのでnextの版で見ること、npm auditで出る警告と修正版に上げた後の結果を、実際の出力で確かめています。

2025年12月に、React に CVSS 10.0 の脆弱性(CVE-2025-55182、React2Shell と呼ばれています)が見つかりました。

その後も React Server Components まわりの脆弱性は続いていて、2026年10月にも Critical のものが出ています。

「うちの React は大丈夫なの?」と思っても、ニュース記事には影響するバージョンの一覧はあっても、自分のアプリの版を確かめる手順まではあまり書かれていません。

この記事では、これまでの脆弱性を一覧にしたうえで、npm ls と npm audit で自分のアプリが対象かを確かめた結果を載せます。

確かめた環境

2026年11月26日に、Docker の node:22(Node 22.23.5・npm 10.9.9)で確かめました。

その日の最新版は、react・react-dom・react-server-dom-webpack が 19.3.1、next が 16.4.6 でした。

$ npm view react version
19.3.1
$ npm view react-server-dom-webpack version
19.3.1
$ npm view next version
16.4.6

脆弱性の内容と影響する版は、React 公式ブログと GitHub のセキュリティアドバイザリ(記事の最後に出典)によるものです。

脆弱性があるのは react ではなく react-server-dom-*

React 公式ブログによると、脆弱性があるのは react や react-dom ではなく、React Server Components を動かす次の3つのパッケージとのことです。

  • react-server-dom-webpack
  • react-server-dom-parcel
  • react-server-dom-turbopack

公式ブログでは、アプリの React のコードがサーバーを使っていなければ影響はなく、React Server Components に対応したフレームワーク・バンドラー・プラグインを使っていなければ影響はない、と書かれています。

影響を受けるフレームワークとして挙げられているのは、next・react-router・waku・@parcel/rsc・@vitejs/plugin-rsc・rwsdk です。

つまり、Vite でブラウザだけで動く React アプリを作っている場合は、対象外ということになります。

これまでの React Server Components の脆弱性

GitHub の facebook/react のセキュリティアドバイザリには、2026年11月26日の時点で10件が載っていました(下の表は、公式ブログに書かれている分を1行にまとめています)。

公開日種類深刻度修正版
2025-12-03リモートコード実行(CVE-2025-55182、React2Shell)Critical(CVSS 10.0)19.0.1・19.1.2・19.2.1
2025-12-11〜12サービス拒否(CVE-2025-55184・CVE-2025-67779)High(CVSS 7.5)19.0.4・19.1.5・19.2.4
2025-12-11ソースコードの漏えい(CVE-2025-55183)Moderate(CVSS 5.3)19.0.4・19.1.5・19.2.4
2026-01-26サービス拒否(CVE-2026-23864)High(CVSS 7.5)19.0.4・19.1.5・19.2.4
2026-04-08サービス拒否High-
2026-05-06サービス拒否High-
2026-07-21Server Functions のサービス拒否High-
2026-10-14リモートコード実行(CVE-2026-126187)Critical(CVSS 9.5)19.0.9・19.1.10・19.2.9・19.3.1
2026-10-14Server Functions のサービス拒否(CVE-2026-130165)High(CVSS 8.2)19.0.9・19.1.10・19.2.9・19.3.1

2025年12月〜2026年1月の分の修正版は、2026年1月26日に更新された公式ブログで「安全」とされている版です(最初の修正が不完全だったため、途中で版が上がっています)。

修正版の「-」は、この記事では各アドバイザリの版を読んでいないものです。

2026-10-14 のアドバイザリによると、影響する版は 19.0.0〜19.0.8・19.1.0〜19.1.9・19.2.0〜19.2.8・19.3.0 とのことです。

下で確かめたとおり、19.2.9 に上げると npm audit の警告は0件になりました。

注意したいのは、公式ブログで「安全」とされていた版が、後の脆弱性でまた対象になっていることです。

2025年12月11日の公式ブログ(2026年1月26日に更新)では 19.0.4・19.1.5・19.2.4 が安全とされていますが、2026年11月の時点で 19.2.4 を npm audit にかけると Critical の警告が出ました(下で載せます)。

一度上げたから終わり、ではないんですね…(´・ω・`)

手順1:react-server-dom-* が入っているかを npm ls で見る

まず、プロジェクトのフォルダで次を実行します。

npm ls react-server-dom-webpack react-server-dom-turbopack react-server-dom-parcel

npm create vite@latest vite-app -- --template react で作った Vite 8.3.8 の React アプリでは、何も入っていませんでした。

$ npm ls react-server-dom-webpack react-server-dom-turbopack react-server-dom-parcel
[email protected] /work/vite-app
`-- (empty)

$ npm ls react react-dom
[email protected] /work/vite-app
+-- [email protected]
| `-- [email protected] deduped
`-- [email protected]

$ npm audit
found 0 vulnerabilities

(empty) のときは終了コードが1になるので、スクリプトの中で使うときは気をつけてください。

react と react-dom を、脆弱性の対象だった時期の 19.2.0 にしたプロジェクトも作ってみました。

$ npm ls react react-dom
[email protected] /work/old-vite
+-- [email protected]
| `-- [email protected] deduped
`-- [email protected]

$ npm audit
found 0 vulnerabilities

react・react-dom だけなら、19.2.0 でも npm audit は何も出しませんでした。

脆弱性のデータベースでも、対象は react-server-dom-* として登録されているということです。

手順2:Next.js は npm ls に出ないので next の版で見る

Next.js のアプリでは、同じ npm ls が当てになりませんでした。

npx create-next-app@latest next-app --yes で作ったアプリ(Next.js 16.4.6)で試した結果です。

$ npm ls next react react-dom
[email protected] /work/next-app
+-- [email protected]
| +-- [email protected] deduped
| +-- [email protected] deduped
| `-- [email protected]
|   `-- [email protected] deduped
+-- [email protected]
| `-- [email protected] deduped
`-- [email protected]

$ npm ls react-server-dom-webpack react-server-dom-turbopack react-server-dom-parcel
[email protected] /work/next-app
`-- (empty)

App Router は React Server Components を使っているのに、react-server-dom-* は (empty) です。

中を見ると、next のパッケージの中に、名前を変えたコピーが入っていました。

$ ls node_modules/next/dist/compiled | grep react-server-dom
react-server-dom-turbopack
react-server-dom-turbopack-experimental
react-server-dom-webpack
react-server-dom-webpack-experimental

$ head -2 node_modules/next/dist/compiled/react-server-dom-turbopack/package.json
{
  "name": "react-server-dom-turbopack-builtin",

このコピーの package.json には version がなく、版を直接は確かめられませんでした。

なので、Next.js のアプリは react の版ではなく、next の版で判断します。

ちなみに、create-next-app が package.json に書いた react は 19.3.0 で、2026-10-14 のアドバイザリが対象に挙げている 19.3.0 と同じ数字です。

それでも Next.js が使うのは next の中のコピーなので、この 16.4.6 のアプリで npm audit をかけると0件でした。

$ npm audit
found 0 vulnerabilities

npx next info でも、next の版と、それが最新かどうかを見られます。

$ npx next info
...
Relevant Packages:
  next: 16.4.6 // Latest available version is detected (16.4.6).
  eslint-config-next: N/A
  react: 19.3.0
  react-dom: 19.3.0
  typescript: 5.9.3

古い Next.js で npm audit をかけた結果

[email protected] と [email protected] を入れたプロジェクトで npm audit をかけると、critical の警告がずらっと出ました!

$ npm audit
# npm audit report

next  9.3.4-canary.0 - 16.4.4
Severity: critical
Next.js is vulnerable to RCE in React flight protocol - https://github.com/advisories/GHSA-9qr9-h5gf-34mp
Next Server Actions Source Code Exposure  - https://github.com/advisories/GHSA-w37m-7fhw-fmv9
Next Vulnerable to Denial of Service with Server Components - https://github.com/advisories/GHSA-mwv6-3258-q52c
...
Next.js: Unauthenticated Remote Code Execution in `use cache` functions returning typed arrays - https://github.com/advisories/GHSA-673q-mjm6-r5xr
...
Depends on vulnerable versions of postcss
Depends on vulnerable versions of sharp
fix available via `npm audit fix`
node_modules/next

postcss  <=8.5.22
Severity: high
...

sharp  <=0.35.5-rc.1
Severity: high
...

3 vulnerabilities (2 high, 1 critical)

To address all issues, run:
  npm audit fix

next の行だけで約50件の警告がありました(途中は省略しています)。

React Server Components の脆弱性(React flight protocol の RCE など)に加えて、画像の最適化やキャッシュなど、Next.js 自体の脆弱性も混ざっています。

next 9.3.4-canary.0 - 16.4.4 とあるので、このとき登録されていた警告は 16.4.5 以降なら対象外ということです。

npm audit fix で next を上げる

表示のとおり npm audit fix を実行しました。

$ npm audit fix
added 3 packages, changed 8 packages, and audited 25 packages in 11s
...
found 0 vulnerabilities

$ npm ls next react react-dom
[email protected] /work/old-next
+-- [email protected]
| +-- [email protected] deduped
| +-- [email protected] deduped
...
`-- [email protected]

next が 16.4.6 に上がり、警告は0件になりました。

react と react-dom は 19.2.0 のままでしたが、上で書いたとおり Next.js は自分の中のコピーを使うので、npm audit は0件です。

package.json は "next": "^16.0.6" のままで、変わったのは package-lock.json と node_modules でした。

^ の範囲の中で上がるので、15.x のように別のメジャーバージョンのまま使っている場合は、そのメジャーバージョンの修正版に上げることになります。

手順3:react-server-dom-* を直接使っているなら、その版を上げる

React Router の RSC や、Vite の @vitejs/plugin-rsc などでは、react-server-dom-* を直接入れることになります。

react-server-dom-webpack を入れたプロジェクトで、版ごとに npm audit をかけました。

19.2.0(React2Shell の対象)

$ npm install [email protected] [email protected] [email protected] webpack
$ npm audit
# npm audit report

react-server-dom-webpack  19.2.0-canary-63779030-20250328 - 19.2.8
Severity: critical
React Server Components are Vulnerable to RCE - https://github.com/advisories/GHSA-fv66-9v8q-g76r
Denial of Service Vulnerability in React Server Components - https://github.com/advisories/GHSA-2m3v-v2m8-q956
Source Code Exposure Vulnerability in React Server Components - https://github.com/advisories/GHSA-925w-6v3x-g4j4
React Server Components have multiple Denial of Service Vulnerabilities - https://github.com/advisories/GHSA-83fc-fqcc-2hmg
React Server Components have a Denial of Service Vulnerability - https://github.com/advisories/GHSA-479c-33wc-g2pg
Facebook React has a Denial of Service Vulnerability in React Server Components - https://github.com/advisories/GHSA-rv78-f8rc-xrxh
react-server-dom: Denial of Service in Server Functions - https://github.com/advisories/GHSA-wx67-qw84-cm4g
React: Unauthenticated Remote Code Execution in React Server Components - https://github.com/advisories/GHSA-xqc2-xf4c-x3h3
fix available via `npm audit fix`
node_modules/react-server-dom-webpack

1 critical severity vulnerability

React2Shell(GHSA-fv66-9v8q-g76r)から 2026年10月の RCE(GHSA-xqc2-xf4c-x3h3)まで、8件が並びました。

19.2.4(2026年1月に「安全」とされた版)

$ npm install [email protected] [email protected] [email protected]
$ npm audit
# npm audit report

react-server-dom-webpack  19.2.0 - 19.2.8
Severity: critical
React Server Components have a Denial of Service Vulnerability - https://github.com/advisories/GHSA-479c-33wc-g2pg
Facebook React has a Denial of Service Vulnerability in React Server Components - https://github.com/advisories/GHSA-rv78-f8rc-xrxh
react-server-dom: Denial of Service in Server Functions - https://github.com/advisories/GHSA-wx67-qw84-cm4g
React: Unauthenticated Remote Code Execution in React Server Components - https://github.com/advisories/GHSA-xqc2-xf4c-x3h3
fix available via `npm audit fix`
node_modules/react-server-dom-webpack

1 critical severity vulnerability

2025年12月〜2026年1月の分は消えましたが、2026年4月以降の4件が残り、まだ critical でした。

19.2.9(2026年10月の修正版)

$ npm install [email protected] [email protected] [email protected]
$ npm ls react react-dom react-server-dom-webpack
[email protected] /work/rsdw
+-- [email protected]
| `-- [email protected] deduped
+-- [email protected]
| +-- [email protected] deduped
| `-- [email protected] deduped
`-- [email protected]

$ npm audit
found 0 vulnerabilities

19.2.9 で、警告は0件になりました。

公式ブログの上げ方の例でも、react・react-dom と react-server-dom-* を一緒に @latest に上げる形になっていたので、版はそろえておくのがよさそうです。

参考:ソースコードの漏えいで漏れるもの

2025年12月11日の公式ブログによると、CVE-2025-55183 では、細工したリクエストで Server Function のソースコードが返ってしまうおそれがあるとのことです。

ソースコードに直接書いた秘密の値は漏れるおそれがある一方、process.env.SECRET のように実行時に読む秘密の値は影響を受けない、と書かれています。

漏れる範囲は Server Function の中のコードで、バンドラーがどこまでインライン化するかによって、他の関数も含まれることがあるようです。

APIキーをコードに直書きしていた場合は、版を上げるだけでなく、キーの作り直しも考えたほうがよさそうです。

参考:ホスティング側の対策と Next.js の上げ方

公式ブログでは、ホスティング事業者が一時的な対策を入れていても、それに頼らずにすぐ更新するよう書かれています。

2025年12月3日の公式ブログには、Next.js のメジャー・マイナーごとに上げる版の一覧(npm install [email protected] など)が載っています。

ただし、その後の脆弱性でこの版もまた対象になっているので、今上げるなら、その時点の npm audit や Next.js のアドバイザリで確かめた版にするのが確実です。

Next.js 自体のアドバイザリ(vercel/next.js)にも、2026年11月3日に Moderate のものが7件、10月14日に画像の最適化での Critical のものが出ています。

出典:

まとめ

React の脆弱性は、react 本体ではなく、React Server Components を動かす react-server-dom-* にありました。

Vite でブラウザだけで動かしている React アプリは対象外で、npm ls で react-server-dom-* が (empty) なら当てはまりません。

Next.js は react-server-dom-* を自分の中に持っているので、npm ls には出ず、next の版で判断します。

一度「安全」とされた版でも後の脆弱性でまた対象になっていたので、定期的に npm audit をかけて確かめるのがおすすめです!

React で何が動いているのかを知りたい人は、こちらもどうぞ〜(`・ω・´)

ReactとNext.jsの違いは?同じページを両方で作って、HTML・ビルド結果・ルーティングを比べた(Next.js 16・Vite 8)

Vite+Reactの環境構築:インストールからdev・build・previewまで(Vite 8で確かめた手順)

Reactとは?読み方と仕組みを、動くコードで確かめながら解説

フィードバックのお願い
この記事のフィードバックがありましたらYoutubeの適当な動画にコメントしていただいたり、お問い合わせからご連絡ください。