arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.10812cs.CR
收藏

GHunter:JavaScript运行时中的通用原型污染小工具

GHunter: Universal Prototype Pollution Gadgets in JavaScript Runtimes

Eric Cornelissen, Mikhail Shcherbakov, Musard Balliu

AI总结:

针对JavaScript运行时中原型污染小工具影响广但缺乏系统检测的问题,提出GHunter流水线,通过动态污点分析与人工验证在Node.js和Deno中发现123个新小工具,还系统化梳理缓解指南并发现一个高危CVE。

摘要:

原型污染是近期影响JavaScript代码的一类漏洞,可引发任意代码执行等高影响攻击。该漏洞根源在于JavaScript基于原型的继承机制,攻击者可借此在运行时向对象的原型注入任意属性。原型污染的影响程度取决于所谓的“良性代码片段(小工具,gadget)”是否存在,这类代码会在无意中读取攻击者控制的属性,进而执行安全敏感操作。现有研究主要关注第三方库和客户端应用中的小工具,而JavaScript运行时环境中的小工具影响范围更广,因为它们会波及所有在这些运行时上执行的应用。\n本文设计、实现并评估了一套名为GHunter的流水线,用于系统检测基于V8的JavaScript运行时中的小工具,重点研究Node.js和Deno。GHunter支持轻量级动态污点分析,可自动识别候选小工具,我们随后对其进行人工验证以生成概念验证利用代码。我们通过修改V8引擎及目标运行时实现了GHunter,并集成了辅助人工验证的功能。在Node.js和Deno的测试套件驱动下,我们使用GHunter对这两个运行时中的小工具展开研究,共在Node.js中发现56个新小工具,在Deno中发现67个新小工具,涉及任意代码执行(19个)、权限提升(31个)、路径遍历(13个)等多种漏洞类型。此外,本文首次从开发指南的角度对现有原型污染及小工具的缓解措施进行了系统化梳理。我们收集了存在漏洞的应用列表,并依据我们提出的指南重新审视其修复方案。通过这项工作,我们发现了一个可导致远程代码执行的高危CVE,其成因是小工具修复不当。

英文摘要:

Prototype pollution is a recent vulnerability that affects JavaScript code, leading to high impact attacks such as arbitrary code execution. The vulnerability is rooted in JavaScript's prototype-based inheritance, enabling attackers to inject arbitrary properties into an object's prototype at runtime. The impact of prototype pollution depends on the existence of otherwise benign pieces of code (gadgets), which inadvertently read from attacker-controlled properties to execute security-sensitive operations. While prior works primarily study gadgets in third-party libraries and client-side applications, gadgets in JavaScript runtime environments are arguably more impactful as they affect any application that executes on these runtimes. In this paper we design, implement, and evaluate a pipeline, GHunter, to systematically detect gadgets in V8-based JavaScript runtimes with prime focus on Node.js and Deno. GHunter supports a lightweight dynamic taint analysis to automatically identify gadget candidates which we validate manually to derive proof-of-concept exploits. We implement GHunter by modifying the V8 engine and the targeted runtimes along with features for facilitating manual validation. Driven by the test suites of Node.js and Deno, we use GHunter in a study of gadgets in these runtimes. We identified a total of 56 new gadgets in Node.js and 67 gadgets in Deno, pertaining to vulnerabilities such as arbitrary code execution (19), privilege escalation (31), path traversal (13), and more. Moreover, we systematize, for the first time, existing mitigations for prototype pollution and gadgets in terms of development guidelines. We collect a list of vulnerable applications and revisit the fixes through the lens of our guidelines. Through this exercise, we identified one high-severity CVE leading to remote code execution, which was due to incorrectly fixing a gadget.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑