[论文解读] Silent Spring: Prototype Pollution Leads to Remote Code Execution in Node.js
本文提出了首个系统性框架,用于在 Node.js 中检测并利用原型污染漏洞实现远程代码执行(RCE),结合多标签静态污点分析以检测污染,以及混合静态-动态分析以识别 Node.js 核心中的通用工具(gadgets)。作者在 Node.js 中发现了 11 个通用工具,并手动利用了 NPM CLI 和 Rocket.Chat 等高影响力应用中的 8 个 RCE 漏洞,证明原型污染可在真实系统中导致完整的 RCE。
Prototype pollution is a dangerous vulnerability affecting prototype-based languages like JavaScript and the Node.js platform. It refers to the ability of an attacker to inject properties into an object's root prototype at runtime and subsequently trigger the execution of legitimate code gadgets that access these properties on the object's prototype, leading to attacks such as Denial of Service (DoS), privilege escalation, and Remote Code Execution (RCE). While there is anecdotal evidence that prototype pollution leads to RCE, current research does not tackle the challenge of gadget detection, thus only showing feasibility of DoS attacks, mainly against Node.js libraries. In this paper, we set out to study the problem in a holistic way, from the detection of prototype pollution to detection of gadgets, with the ambitious goal of finding end-to-end exploits beyond DoS, in full-fledged Node.js applications. We build the first multi-staged framework that uses multi-label static taint analysis to identify prototype pollution in Node.js libraries and applications, as well as a hybrid approach to detect universal gadgets, notably, by analyzing the Node.js source code. We implement our framework on top of GitHub's static analysis framework CodeQL to find 11 universal gadgets in core Node.js APIs, leading to code execution. Furthermore, we use our methodology in a study of 15 popular Node.js applications to identify prototype pollutions and gadgets. We manually exploit eight RCE vulnerabilities in three high-profile applications such as NPM CLI, Parse Server, and Rocket.Chat. Our results provide alarming evidence that prototype pollution in combination with powerful universal gadgets lead to RCE in Node.js.
研究动机与目标
- 填补先前研究仅检测原型污染用于拒绝服务(DoS)攻击的空白,将检测范围扩展至远程代码执行(RCE)利用。
- 识别并验证 Node.js 核心 API 中可被链式利用以实现 RCE 的通用工具。
- 开发一种可扩展的、多阶段框架,实现对真实世界 Node.js 应用中原型污染及基于工具的 RCE 的端到端检测。
- 通过手动利用生产级应用中的 RCE 漏洞,证明原型污染在实际系统中实现可行且严重的攻击。
- 建立一种系统化方法,用于检测基于原型的对象注入漏洞(POIVs),将其作为 JavaScript 生态系统中一类新型利用方式。
提出的方法
- 在 CodeQL 上使用多标签静态污点分析,通过追踪不受信任数据流进入 Object.prototype 修改来检测原型污染。
- 设计一种混合分析方法,结合 Node.js 源代码的静态分析与动态污点追踪,以识别核心 API 中的通用工具。
- 调整静态分析以提高召回率而非精度,从而提升在真实代码库中检测罕见注入接收点的能力。
- 通过代码级分析及对真实应用的手动利用,手动验证和确认工具的可达性与可利用性。
- 使用来自安全公告的 100 个漏洞包的精选数据集,训练并验证污染检测组件。
- 将该框架应用于 15 个流行的 Node.js 应用,以识别污染向量及可利用的工具链。
实验结果
研究问题
- RQ1原型污染在 Node.js 中是否可以系统性地被利用以实现远程代码执行(RCE),而不仅限于已知的 DoS 攻击?
- RQ2可通过原型污染触发的 Node.js 核心中通用工具的特征和位置是什么?
- RQ3如何结合静态与动态分析,以检测真实世界 Node.js 应用中可利用的工具链?
- RQ4现有用于原型污染的静态分析工具因召回率低,是否在很大程度上遗漏了关键的 RCE 向量?
- RQ5是否可以利用原型污染来成功利用 NPM CLI、Parse Server 和 Rocket.Chat 等高影响力生产应用?
主要发现
- 作者在 Node.js 核心 API 中发现了 11 个通用工具,可通过原型污染触发,并可用于任何使用这些 API 的应用程序中实现 RCE。
- 在真实应用中手动利用了 8 个 RCE 漏洞,包括 NPM CLI、Parse Server 和 Rocket.Chat,证实了端到端攻击的可行性。
- 所提出的多标签静态污点分析框架在召回率上显著优于当前最先进的工具 ODGen,仅带来适度的精度下降。
- 原型污染不仅限于 DoS 攻击;当与通用工具结合时,可在生产应用中实现完整的代码执行。
- 本研究揭示,Node.js 核心中的通用工具引入了一类新型威胁:通过原型变异滥用未使用的代码路径,以劫持控制流。
- 混合分析方法成功识别出静态分析单独无法发现的工具链,尤其在复杂或间接数据流中表现突出。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。