Silent Spring:原型污染导致Node.js中的远程代码执行
Silent Spring: Prototype Pollution Leads to Remote Code Execution in Node.js
摘要:
原型污染是一个危险的漏洞,影响基于原型的语言,如JavaScript和Node.js平台。它是指攻击者能够在运行时将属性注入对象的根原型,并随后触发执行访问对象原型上这些属性的合法代码小工具,从而导致拒绝服务(DoS),特权提升和远程代码执行(RCE)等攻击。虽然有轶事证据表明原型污染导致RCE,但目前的研究并没有解决小工具检测的挑战,因此只显示了DoS攻击的可行性,主要针对Node.js库。在本文中,我们开始以整体的方式研究这个问题,从原型污染的检测到小工具的检测,其雄心勃勃的目标是在成熟的Node.js应用程序中找到端到端的攻击。我们构建了第一个多阶段框架,该框架使用多标签静态污点分析来识别Node.js库和应用程序中的原型污染,以及通过分析Node.js源代码来检测通用小工具的混合方法。我们在GitHub的静态分析框架CodeQL之上实现我们的框架,以在核心Node.js API中找到11个通用小工具,从而执行代码。此外,我们使用我们的方法研究了15个流行的Node.js应用程序,以识别原型污染和小工具。我们手动利用三个高知名度应用程序(如NPM CLI,Parse Server和Rocket.Chat)中的八个RCE漏洞。我们的研究结果提供了令人震惊的证据,原型污染与强大的通用小工具相结合,导致Node.js中的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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。