文章摘要
Next.js的React Server Components存在远程代码执行漏洞(GHSA-9qr9-h5gf-34mp),可能允许攻击者执行任意代码。该安全公告由Vercel发布在GitHub上,属于应用安全问题。
文章总结
React Server Components 远程代码执行漏洞安全通告
核心内容: 1. 漏洞概述: - 漏洞存在于React Server Components中,影响Next.js框架(使用App Router的15.x和16.x版本) - 被追踪为CVE-2025-55182
- 受影响版本:
- Next.js:≥14.3.0-canary.77、≥15、≥16
- React相关包:19.0.0、19.1.0、19.1.1、19.2.0版本
- 涉及组件:
- react-server-dom-parcel
- react-server-dom-turbopack
- react-server-dom-webpack
- 修复版本:
- Next.js:v16.0.7、v15.5.7、v15.4.8、v15.3.6、v15.2.6、v15.1.9、v15.0.5
- React:19.0.1、19.1.2、19.2.1
- 风险评级:
- CVSS评分:10.0(严重级别)
- 攻击向量:网络攻击
- 影响范围:高机密性/完整性/可用性影响
- 建议措施:
- 使用稳定版的用户应立即升级到修复版本
- 使用14.3 canary版本的用户应降级到14.x稳定版或14.3.0-canary.76
- 漏洞报告:
- 由安全研究员@lachlan2k发现并报告
- 分配CVE编号:CVE-2025-66478
(注:已过滤原始内容中的导航菜单、页脚信息等非核心内容,保留关键安全信息)
评论总结
以下是评论内容的总结:
1. 对React安全漏洞的严重性表示震惊
- 观点:CVE 10.0的高分表明漏洞非常严重,尤其是对广泛使用的项目来说。
引用:
"CVE 10.0 is bonkers for a project this widely used" (AgentK20)
"The CVE says the that flaw is in React Server Components, which implies strongly that this is a RCE on the backend (!!), not the client." (ajross)
2. 对React设计选择的批评
- 观点:通过“魔法”方式连接前后端的设计存在根本性问题,容易引发安全漏洞。
引用:
"It's almost like trying to magically wire up your frontend to the backend through magical functions is a bad idea." (bitbasher)
"I'm just laughing because I called it when they were in the 'random idea x posts' about use server." (dizlexic)
3. 漏洞技术细节分析
- 观点:漏洞源于React Server Components不安全地反序列化客户端请求,导致远程代码执行(RCE)。
引用:
"The vulnerable code unsafely deserializes payloads from HTTP requests to Server Function endpoints." (embedding-shape)
"React translates requests on the client into HTTP requests which are forwarded to a server... An unauthenticated attacker could craft a malicious HTTP request." (embedding-shape)
4. 对React复杂性和设计理念的质疑
- 观点:React Server Components的复杂性并未带来明显优势,反而增加了风险。
引用:
"till this day, I don't know the substantial benefits of React Server Components over say classically rendered html pages + using htmx." (dzonga)
"React went the opposite way: the API surface is whatever your bundler can see, and the endpoint is whatever the client asks for." (coffeecoders)
5. 平台保护措施
- 观点:部分平台(如Vercel和Cloudflare)已提供针对此漏洞的保护。
引用:
"Projects hosted on Vercel benefit from platform-level protections that already block malicious request patterns." (karimf)
"Cloudflare WAF proactively protects against React vulnerability." (karimf)
6. 漏洞修复与设计反思
- 观点:修复补丁通过限制暴露函数来解决问题,但更深层次的设计问题可能仍存在。
引用:
"this pattern appears 4 times and looks like it is reducing the functions that are exposed to the 'whitelist'." (benmmurphy)
"React never really acknowledged that it was building an RPC layer... they all start with schemas, explicit service definitions." (coffeecoders)