JavaScript has become one of the most widely used programming languages for web development, server-side programming, and even micro-controllers for IoT. However, its extremely functional and dynamic features degrade the performance and precision of static analysis. Moreover, the variety of built-in functions and host environments requires excessive manual modeling of their behaviors. To alleviate these problems, researchers have proposed various ways to leverage dynamic analysis during JavaScript static analysis. However, they do not fully utilize the high performance of dynamic analysis and often sacrifice the soundness of static analysis. In this paper, we present dynamic shortcuts, a new technique to flexibly switch between abstract and concrete execution during JavaScript static analysis in a sound way. It can significantly improve the analysis performance and precision by using highly-optimized commercial JavaScript engines and lessen the modeling efforts for opaque code. We actualize the technique via $\text{SAFE}_\textsf{DS}$, an extended combination of $\text{SAFE}$ and Jalangi, a static analyzer and a dynamic analyzer, respectively. We evaluated $\text{SAFE}_\textsf{DS}$ using 269 official tests of Lodash 4 library. Our experiment shows that $\text{SAFE}_\textsf{DS}$ is 7.81x faster than the baseline static analyzer, and it improves the precision to reduce failed assertions by 12.31% on average for 22 opaque functions.
翻译:JavaScript 已经成为互联网开发、服务器侧编程和甚至IoT 最广泛使用的微控制程序语言之一。 然而,它的功能和动态特性极强,降低了静态分析的性能和精确度。 此外,内建功能和主机环境的种类要求对其行为进行过度的手工模型。为了缓解这些问题,研究人员提出了在 JavaScript 静态分析中利用动态分析的各种办法。然而,他们并没有充分利用动态分析的高性能,往往牺牲静态分析的正确性能。在本文中,我们提出了动态捷径,这是一种在 JavaScript 静态分析期间,在抽象和具体执行之间灵活转换的新技术。通过使用高度优化的商用 JavaScarpit 引擎和减少不透明代码的建模工作,可以大大提高分析的性能和精确性。 我们通过 $@text{SA_textf{DSA} 和 Jalangi, 一种静态分析器和动态分析器,在Javascrial $ salticlex} 中,我们用$\\\\x deviews sal deal deals surals supal supald supald supals supald.