Stubbifier: debloating dynamic server-side Java']JavaScript applications

被引:2
|
作者
Turcotte, Alexi [1 ]
Arteca, Ellen [1 ]
Mishra, Ashish [2 ]
Alimadadi, Saba [3 ]
Tip, Frank [1 ]
机构
[1] Northeastern Univ, Khoury Coll Comp Sci, Boston, MA 02115 USA
[2] Purdue Univ, W Lafayette, IN 47907 USA
[3] Simon Fraser Univ, Comp Sci, Vancouver, BC, Canada
基金
加拿大自然科学与工程研究理事会; 美国国家科学基金会;
关键词
Debloating; Program analysis; !text type='Java']Java[!/text]Script; Node; !text type='js']js[!/text; STATIC ANALYSIS;
D O I
10.1007/s10664-022-10195-6
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
JavaScript is an increasingly popular language for server-side development, thanks in part to the Node.js runtime environment and its vast ecosystem of modules. With the Node.js package manager npm, users are able to easily include external modules as dependencies in their projects. However, npm installs modules with all of their functionality, even if only a fraction is needed, which causes an undue increase in code size. Eliminating this unused functionality from distributions is desirable, but the sound analysis required to find unused code is difficult due to JavaScript's extreme dynamicity. We present a fully automatic technique that identifies unused code by constructing static or dynamic call graphs from the application's tests, and replacing code deemed unreachable with either file- or function-level stubs. Due to JavaScript's highly dynamic nature, call graph construction may suffer from unsoundness, i.e., code identified as unused may in fact be reachable. To handle such cases, if a stub is called, it will fetch and execute the original code on-demand to preserve the application's behavior. The technique also provides an optional guarded execution mode to guard application against injection vulnerabilities in untested code that resulted from stub expansion. This technique is implemented in an open source tool called Stubbifier, designed to help package developers to produce a minimal production distribution. Stubbifier supports the ECMAScript 2019 standard. In an empirical evaluation on 15 Node.js applications and 75 clients of these applications, Stubbifier reduced application size by 56% on average while incurring only minor performance overhead. The evaluation also shows that Stubbifier's guarded execution mode is capable of preventing several known injection vulnerabilities that are manifested in stubbed-out code. Finally, Stubbifier can work alongside bundlers, popular JavaScript tools for bundling an application with its dependencies. For the considered subject applications, we measured an average size reduction of 37% in bundled distributions.
引用
收藏
页数:36
相关论文
共 50 条
  • [1] Stubbifier: debloating dynamic server-side JavaScript applications
    Alexi Turcotte
    Ellen Arteca
    Ashish Mishra
    Saba Alimadadi
    Frank Tip
    [J]. Empirical Software Engineering, 2022, 27
  • [2] Workload Characterization of Server-Side Java']JavaScript
    Ogasawara, Takeshi
    [J]. 2014 IEEE INTERNATIONAL SYMPOSIUM ON WORKLOAD CHARACTERIZATION (IISWC), 2014, : 13 - 21
  • [3] A Software Development Course Based on Server-Side Java']Javascript
    Holliday, Mark A.
    Scott, Andrew S.
    [J]. 2016 IEEE FRONTIERS IN EDUCATION CONFERENCE (FIE), 2016,
  • [4] Querying MongoDB with LINQ in a Server-side Java']JavaScript Environment
    Nakabasami, Kousuke
    Amagasa, Toshiyuki
    Kitagawa, Hiroyuki
    [J]. 2013 16TH INTERNATIONAL CONFERENCE ON NETWORK-BASED INFORMATION SYSTEMS (NBIS 2013), 2013, : 344 - 349
  • [5] Server-Side Type Profiling for Optimizing Client-Side Java']JavaScript Engines
    Kedlaya, Madhukar N.
    Robatmili, Behnam
    Hardekopf, Ben
    [J]. ACM SIGPLAN NOTICES, 2016, 51 (02) : 140 - 153
  • [6] Finding Server-Side Endpoints with Static Analysis of Client-Side Java']JavaScript
    Sigalov, Daniil
    Gamayunov, Dennis
    [J]. COMPUTER SECURITY. ESORICS 2023 INTERNATIONAL WORKSHOPS, CPS4CIP, PT II, 2024, 14399 : 442 - 458
  • [7] Asqium: A Java']JavaScript Plugin Framework for Extensible Client and Server-Side Components
    Triglianos, Vasileios
    Pautasso, Cesare
    [J]. ENGINEERING THE WEB IN THE BIG DATA ERA, 2015, 9114 : 81 - 98
  • [8] Server-side Web Development with Java']JavaScript and Node.js']js
    Ortiz, Ariel
    [J]. PROCEEDINGS OF THE 45TH ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION (SIGCSE'14), 2014, : 747 - 747
  • [9] DETECTING SERVER-SIDE ENDPOINTS IN WEB APPLICATIONS BASED ON STATIC ANALYSIS OF CLIENT-SIDE Java']JavaScript CODE
    Sigalov, D. A.
    Khashaev, A. A.
    Gamayunov, D. Yu.
    [J]. PRIKLADNAYA DISKRETNAYA MATEMATIKA, 2021, (53): : 32 - 54
  • [10] Performance Evaluation of Server-side Java']JavaScript for Healthcare Hub Server in Remote Healthcare Monitoring System
    Nkenyereye, Lionel
    Jang, Jong-Wook
    [J]. 7TH INTERNATIONAL CONFERENCE ON EMERGING UBIQUITOUS SYSTEMS AND PERVASIVE NETWORKS (EUSPN 2016)/THE 6TH INTERNATIONAL CONFERENCE ON CURRENT AND FUTURE TRENDS OF INFORMATION AND COMMUNICATION TECHNOLOGIES IN HEALTHCARE (ICTH-2016), 2016, 98 : 382 - 387