React 服务器组件中的关键安全漏洞

2025年12月3日 由 React 团队

🌐 December 3, 2025 by The React Team


React 服务器组件中存在一个未经身份验证的远程代码执行漏洞。

🌐 There is an unauthenticated remote code execution vulnerability in React Server Components.

我们建议立即升级。

🌐 We recommend upgrading immediately.


11月29日,Lachlan Davidson 报告了 React 中的一个安全漏洞,该漏洞允许通过利用 React 解码发送到 React 服务器函数端点的有效负载时的缺陷进行未经认证的远程代码执行。

🌐 On November 29th, Lachlan Davidson reported a security vulnerability in React that allows unauthenticated remote code execution by exploiting a flaw in how React decodes payloads sent to React Server Function endpoints.

即使你的应用没有实现任何 React 服务器函数端点,如果你的应用支持 React 服务器组件,它仍然可能容易受到攻击。

🌐 Even if your app does not implement any React Server Function endpoints it may still be vulnerable if your app supports React Server Components.

该漏洞已作为 CVE-2025-55182 公布,CVSS 评分为 10.0。

🌐 This vulnerability was disclosed as CVE-2025-55182 and is rated CVSS 10.0.

该漏洞存在于以下版本中:19.0、19.1.0、19.1.1 和 19.2.0:

🌐 The vulnerability is present in versions 19.0, 19.1.0, 19.1.1, and 19.2.0 of:

需要立即行动

🌐 Immediate Action Required

在版本 19.0.119.1.219.2.1 中引入了一个修复。如果你正在使用上述任何一个软件包,请立即升级到任意修复版本。

🌐 A fix was introduced in versions 19.0.1, 19.1.2, and 19.2.1. If you are using any of the above packages please upgrade to any of the fixed versions immediately.

如果你的应用的 React 代码不使用服务器,那么你的应用不会受到此漏洞的影响。如果你的应用不使用支持 React 服务器组件的框架、打包工具或打包工具插件,那么你的应用不会受到此漏洞的影响。

🌐 If your app’s React code does not use a server, your app is not affected by this vulnerability. If your app does not use a framework, bundler, or bundler plugin that supports React Server Components, your app is not affected by this vulnerability.

受影响的框架和打包工具

🌐 Affected frameworks and bundlers

一些 React 框架和打包工具依赖于、具有对等依赖或包含易受攻击的 React 包。受影响的 React 框架和打包工具如下:nextreact-routerwaku@parcel/rsc@vitejs/plugin-rscrwsdk

🌐 Some React frameworks and bundlers depended on, had peer dependencies for, or included the vulnerable React packages. The following React frameworks & bundlers are affected: next, react-router, waku, @parcel/rsc, @vitejs/plugin-rsc, and rwsdk.

请参阅下面的更新说明了解如何升级到这些补丁。

🌐 See the update instructions below for how to upgrade to these patches.

托管服务提供商缓解措施

🌐 Hosting Provider Mitigations

我们已经与多家托管服务提供商合作,采取了临时缓解措施。

🌐 We have worked with a number of hosting providers to apply temporary mitigations.

你不应该依赖这些来保护你的应用,并且仍然需要立即更新。

🌐 You should not depend on these to secure your app, and still update immediately.

漏洞概述

🌐 Vulnerability overview

React 服务器功能 允许客户端调用服务器上的函数。React 提供集成点和工具,框架和打包器使用这些工具帮助 React 代码在客户端和服务器上运行。React 将客户端的请求转换为 HTTP 请求,并将其转发到服务器。在服务器上,React 将 HTTP 请求转换为函数调用,并将所需的数据返回给客户端。

未经认证的攻击者可能构造一个针对任何服务器函数端点的恶意 HTTP 请求,当该请求被 React 反序列化时,会在服务器上实现远程代码执行。在修复程序推出完成后,将提供该漏洞的更多详细信息。

🌐 An unauthenticated attacker could craft a malicious HTTP request to any Server Function endpoint that, when deserialized by React, achieves remote code execution on the server. Further details of the vulnerability will be provided after the rollout of the fix is complete.

更新说明

🌐 Update Instructions

注意

这些说明已更新,以包含新的漏洞:

🌐 These instructions have been updated to include the new vulnerabilities:

有关更多信息,请参阅后续博客文章

🌐 See the follow-up blog post for more info.


更新于2026年1月26日.

Next.js

所有用户都应升级到其发布版本中的最新补丁版本:

🌐 All users should upgrade to the latest patched version in their release line:

npm install next@14.2.35 // for 13.3.x, 13.4.x, 13.5.x, 14.x
npm install next@15.0.8 // for 15.0.x
npm install next@15.1.12 // for 15.1.x
npm install next@15.2.9 // for 15.2.x
npm install next@15.3.9 // for 15.3.x
npm install next@15.4.11 // for 15.4.x
npm install next@15.5.10 // for 15.5.x
npm install next@16.0.11 // for 16.0.x
npm install next@16.1.5 // for 16.1.x

npm install next@15.6.0-canary.60 // for 15.x canary releases
npm install next@16.1.0-canary.19 // for 16.x canary releases

15.0.8, 15.1.12, 15.2.9, 15.3.9, 15.4.10, 15.5.10, 15.6.0-canary.61, 16.0.11, 16.1.5

如果你使用的是 Next.js 13 的 13.3 版本或更高版本(13.3.x13.4.x13.5.x),请升级到 14.2.35 版本。

🌐 If you are on version 13.3 or later version of Next.js 13 (13.3.x, 13.4.x, or 13.5.x) please upgrade to version 14.2.35.

如果你正在使用 next@14.3.0-canary.77 或更高版本的 canary 版本,请降级到最新的稳定 14.x 版本:

🌐 If you are on next@14.3.0-canary.77 or a later canary release, downgrade to the latest stable 14.x release:

npm install next@14

请查看 Next.js 博客 了解最新的更新说明,并查看 之前的更新日志 获取更多信息。

🌐 See the Next.js blog for the latest update instructions and the previous changelog for more info.

React Router

如果你正在使用 React Router 不稳定的 RSC API,则应升级以下 package.json 依赖(如果存在):

🌐 If you are using React Router’s unstable RSC APIs, you should upgrade the following package.json dependencies if they exist:

npm install react@latest
npm install react-dom@latest
npm install react-server-dom-parcel@latest
npm install react-server-dom-webpack@latest
npm install @vitejs/plugin-rsc@latest

Expo

要了解更多关于缓解的信息,请阅读文章 expo.dev/changelog

🌐 To learn more about mitigating, read the article on expo.dev/changelog.

红木 SDK

🌐 Redwood SDK

确保你使用的是 rwsdk>=1.0.0-alpha.0

🌐 Ensure you are on rwsdk>=1.0.0-alpha.0

获取最新测试版:

🌐 For the latest beta version:

npm install rwsdk@latest

升级到最新的 react-server-dom-webpack

🌐 Upgrade to the latest react-server-dom-webpack:

npm install react@latest react-dom@latest react-server-dom-webpack@latest

有关更多迁移说明,请参见 Redwood 文档

🌐 See Redwood docs for more migration instructions.

瓦库

🌐 Waku

升级到最新的 react-server-dom-webpack

🌐 Upgrade to the latest react-server-dom-webpack:

npm install react@latest react-dom@latest react-server-dom-webpack@latest waku@latest

请参阅 Waku 公告 获取更多迁移说明。

🌐 See Waku announcement for more migration instructions.

@vitejs/plugin-rsc

升级到最新的 RSC 插件:

🌐 Upgrade to the latest RSC plugin:

npm install react@latest react-dom@latest @vitejs/plugin-rsc@latest

react-server-dom-parcel

更新到最新版本:

🌐 Update to the latest version:

npm install react@latest react-dom@latest react-server-dom-parcel@latest

react-server-dom-turbopack

更新到最新版本:

🌐 Update to the latest version:

npm install react@latest react-dom@latest react-server-dom-turbopack@latest

react-server-dom-webpack

更新到最新版本:

🌐 Update to the latest version:

npm install react@latest react-dom@latest react-server-dom-webpack@latest

React Native

对于不使用 monorepo 或 react-dom 的 React Native 用户,你的 react 版本应固定在 package.json 中,并且不需要其他步骤。

🌐 For React Native users not using a monorepo or react-dom, your react version should be pinned in your package.json, and there are no additional steps needed.

如果你在 monorepo 中使用 React Native,你应该只更新已安装的受影响的包:

🌐 If you are using React Native in a monorepo, you should update only the impacted packages if they are installed:

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

这是为了缓解安全公告的要求,但你不需要更新 reactreact-dom,所以这不会在 React Native 中引起版本不匹配错误。

🌐 This is required to mitigate the security advisory, but you do not need to update react and react-dom so this will not cause the version mismatch error in React Native.

有关更多信息,请参见此问题

🌐 See this issue for more information.

时间线

🌐 Timeline

  • 11月29日:Lachlan Davidson通过Meta 奖金漏洞计划报告了该安全漏洞。
  • 11月30日:Meta 安全研究人员确认了问题,并开始与 React 团队合作修复。
  • 12月1日:已创建一个修复程序,React 团队开始与受影响的托管提供商和开源项目合作,以验证修复程序、实现缓解措施并推出修复程序
  • 12月3日:修复已发布到 npm,并公开披露为 CVE-2025-55182。

归因

🌐 Attribution

感谢 Lachlan Davidson 发现、报告并努力帮助修复此漏洞。

🌐 Thank you to Lachlan Davidson for discovering, reporting, and working to help fix this vulnerability.