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 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 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 RCE in two high-profile applications. Our results provide alarming evidence that prototype pollution in combination with powerful universal gadgets lead to RCE in Node.js.
翻译:原型污染是影响原型语言的危险脆弱性, 比如 JavaScript 和 Node.js 平台。 它指的是攻击者能够将特性输入物体根原型原型, 并随后触发执行合法代码装置, 从而在物体原型上访问这些特性, 从而导致像 DoS 、 特权升级和远程代码执行这样的攻击。 虽然有传闻证据表明原型污染导致RCE, 但目前的研究并不能应对工具检测的挑战, 从而只能显示 DoS 袭击 Node.js 图书馆的可行性。 在本文中, 我们开始以整体方式研究问题, 从检测原型污染到检测小道的原型, 其雄心目标是在全方位的 Node.js 应用程序中找到端到端端端点的利用。 我们用多标签静态垃圾分析工具在 Node.js 图书馆和应用中发现原型污染, 以及一种混合方法来检测通用的GE, 特别是, 分析我们使用高端点的A- Lde 工具, 和高端点的Gireal 工具, 。