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

HODOR:通过系统调用限制缩小 Node.js 的攻击面

HODOR: Shrinking Attack Surface on Node.js via System Call Limitation

Wenya Wang, Xingwei Lin, Jingyi Wang, Wang Gao, Dawu Gu, Wei Lv, Jiashui Wang

AI总结:

针对Node.js任意代码执行漏洞的系统调用级攻击面扩大问题,提出轻量级运行时保护系统HODOR,通过构建精确调用图生成系统调用白名单并结合seccomp实施限制,成功将83个真实应用的攻击面平均缩减至16.75%,且运行开销低于3%。

摘要:

Node.js 使用系统调用为 Node.js 应用程序提供系统交互能力。然而,这种便利性是有代价的,即 JavaScript 任意代码执行(ACE)漏洞的攻击面扩大到了系统调用级别。现有的 JavaScript 代码级保护技术(通过代码精简或读写执行权限限制)与针对新兴关键系统调用级漏洞利用的定向防御之间存在明显差距。为了填补这一空白,我们设计并实现了 HODOR,这是一个基于在运行 Node.js 应用程序时实施精确系统调用限制的轻量级运行时保护系统。HODOR 通过解决几个非平凡的技术挑战实现了这一目标。首先,HODOR 需要为 Node.js 应用程序(JavaScript)及其底层 Node.js 框架(JavaScript 和 C/C++)构建高质量的调用图。具体而言,HODOR 在 JavaScript 和 C/C++ 级别整合了几项重要优化,以改进最先进的工具,从而构建更精确的调用图。然后,HODOR 分别创建主线程白名单和线程池白名单,其中包含基于调用图映射识别出的必要系统调用。最后,利用这些白名单,HODOR 使用 Linux 内核特性安全计算模式(seccomp)实施轻量级系统调用限制,以缩小攻击面。我们利用 HODOR 保护了 83 个受到任意代码/命令执行攻击的真实 Node.js 应用程序。HODOR 平均可将攻击面减少至 16.75%,且运行时开销可忽略不计(即 <3%)。

英文摘要:

Node.js provides Node.js applications with system interaction capabilities using system calls. However, such convenience comes with a price, i.e., the attack surface of JavaScript arbitrary code execution (ACE) vulnerabilities is expanded to the system call level. There lies a noticeable gap between existing protection techniques in the JavaScript code level (either by code debloating or read-write-execute permission restriction) and a targeted defense for emerging critical system call level exploitation. To fill the gap, we design and implement HODOR, a lightweight runtime protection system based on enforcing precise system call restrictions when running a Node.js application. HODOR achieved this by addressing several nontrivialial technical challenges. First, HODOR requires to construct high-quality call graphs for both the Node.js application (in JavaScript) and its underlying Node.js framework (in JavaScript and C/C++). Specifically, HODOR incorporates several important optimizations in both the JavaScript and C/C++ level to improve the state-of-the-art tools for building more precise call graphs. Then, HODOR creates the main-thread whitelist and the thread-pool whitelist respectively containing the identified necessary system calls based on the call graphs mappings. Finally, with the whitelists, HODOR implements lightweight system call restriction using the Linux kernel feature Secure Computing Mode (seccomp) to shrink the attack surface. We utilize HODOR to protect 83 real-world Node.js applications compromised by arbitrary code/command execution attacks. HODOR could reduce the attack surface to 16.75% on average with negligible runtime overhead (i.e., <3%).

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

↑