An Empirical Study of JavaScript Inclusion Security Issues in Chrome Extensions

Chong Guan · 2025

Read An Empirical Study of JavaScript Inclusion Security Issues in Chrome Extensions by Chong Guan (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-19456.txt.

Introduction

Guan measured JavaScript inclusion risks in browser extensions for this study from twenty twenty-five. Extensions often pull in code snippets, local or remote, to add features. Web page inclusions have been studied for years, but extension inclusions had not. The author combined static and dynamic analysis across more than thirty-six thousand Chrome extensions.

The scan found over three hundred fifty thousand inclusions. Most came from local files, which limits the danger. Still, twenty-two remote inclusions were flagged as vulnerable, opening a path to arbitrary code in the extension's context. Outdated, flawed libraries were also common, even in popular extensions. The study urges tighter inclusion hygiene.

Catalog record

CREATORChong Guan
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE42 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-19456

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

An Empirical Study of JavaScript Inclusion Security Issues in Chrome Extensions Chong Guan Abstract JavaScript, a scripting language employed to augment the capabilities of web browsers within web pages or browser extensions, utilizes code segments termed JavaScript inclusions. While the security aspects of JavaScript inclusions in web pages have undergone substantial scrutiny, a thorough investigation into the security of such inclusions within browser extensions remains absent, despite the divergent security paradigms governing these environments. This study presents a systematic measurement of JavaScript inclusions in Chrome extensions, employing a hybrid methodology encompassing static and dynamic analysis to identify these inclusions. The analysis of 36,324 extensions revealed 350,784 JavaScript inclusions. Subsequent security assessment indicated that, although the majority of these inclusions originate from local files within the extensions rather than external servers, 22 instances of vulnerable remote JavaScript inclusions were identified. These remote inclusions present potential avenues for malicious actors to execute arbitrary code within the extension’s execution context. Furthermore, an analysis of JavaScript library utilization within Chrome extensions disclosed the prevalent use of susceptible and outdated libraries, notably within numerous widely adopted extensions. 1 Introduction Chrome extensions are small web applications developed in JavaScript to extend the functionality of the Chrome browser. For example, the AdBlock extension removes advertisements in web pages and has millions of users. Imported third-party JavaScript code has been problematic in web applications, introducing many vulnerabilities [ 24 , 18 ] . The risks are amplified in Chrome extensions, as they possess greater privileges. Consequently, a vulnerable or malicious imported JavaScript code within a Chrome extension can lead to more severe consequences. The security implications of imported third-party JavaScript have been thoroughly investigated in standard web pages. For example, Nikiforakis et al. [ 24 ] examined JavaScript inclusions in the top 10,000 Alexa [ 1 ] websites, evaluated the servers providing the JavaScript, and identified four categories of vulnerabilities associated with insecure third-party inclusion practices. Tobias et al. [ 18 ] analyzed client-side JavaScript library usage and discovered that numerous websites employ outdated and vulnerable libraries. However, a comprehensive examination of JavaScript inclusion issues in Chrome extensions, which possess a unique security architecture, is lacking. First, JavaScript is utilized in diverse components of a Chrome extension. In web applications, all JavaScript code is within script HTML tags. Chrome extensions employ a privilege-separation architecture [ 26 ] , segregating an extension into two distinct components: ContentScript and the core extension . ContentScripts interact with web pages rendered in the Chrome browser but operate without elevated privileges. Core extensions, conversely, do not directly interact with web pages and execute with full privileges. Second, Chrome extensions have more extensive privileges than web applications, managed through a permission system. Extensions must request permissions from the user during installation. Consequently, malicious code injected through vulnerable JavaScript inclusions can only exploit the granted permissions. This paper reports on an empirical study of JavaScript inclusions in Chrome extensions, undertaken to facilitate an evaluation of Chrome extension security. Initially, a collection of 36324 Chrome extensions was assembled, and a subset of 18890 extensions was subjected to longitudinal version tracking over a six-month period. Subsequently, JavaScript inclusions within the Chrome extensions were identified using both dynamic and static analysis. An empirical study of vulnerable JavaScript inclusions revealed 33 instances of remote inclusions susceptible to manipulation, enabling arbitrary code execution within the extension’s execution environment. Finally, an analysis of JavaScript library usage within Chrome extensions identified the prevalent use of vulnerable and outdated libraries in these extensions. The conventional methodology for gathering JavaScript inclusions in web applications proved inadequate for the context of Chrome extensions. Specifically, web application analysis typically employs a proxy to intercept JavaScript inclusion requests between the browser and server. However, this approach is ineffective for Chrome extensions, as local JavaScript file imports do not generate web requests. To address this, we employed a hybrid approach, integrating static and dynamic analysis methods. The static analysis involved parsing web pages and extracting JavaScript inclusions identified by the script HTML tag. To capture dynamically generated scripts, which static analysis overlooks, we implemented a dynamic analysis technique. This involved injecting and executing JavaScript code within the loaded extension’s web page to enumerate all JavaScript inclusions. Static and dynamic methods provide complementary identification of JavaScript inclusions: static analysis detects inclusions before webpage loading, while dynamic analysis captures inclusions in the fully rendered webpage. For instance, JavaScript inclusions within a redirect page, which is not fully rendered, are not detectable by dynamic analysis. In total, we analyzed 36324 Chrome extensions and identified 723798 JavaScript inclusions. Of these, 16.54% were ContentScripts, 11.32% were background scripts, and the remainder were embedded within extension webpages. A total of 29992 inclusions were loaded from external servers. To investigate vulnerabilities within Chrome extension JavaScript inclusions, we adopted the analytical framework developed by Nikiforakis et al. (2012). Their research, which analyzed JavaScript inclusions in the top 10,000 Alexa websites, delineated four categories of vulnerable JavaScript inclusions. Based on these categories, our study identified 33 vulnerable JavaScript inclusions in Chrome extensions, which could enable attackers to execute arbitrary code within susceptible extensions. Compared to the Alexa top 10,000 websites, Chrome extensions exhibit a lower prevalence of vulnerable cases. This disparity arises from the tendency of Chrome extensions to utilize local JavaScript inclusions rather than retrieving them from remote servers. While 687 distinct remote servers provided JavaScript inclusions to Chrome extensions, Nikiforakis et al. (2012) identified 20,225 unique remote servers. However, when considering only remote JavaScript inclusions, the proportion of vulnerable instances is approximately equivalent between Chrome extensions and web applications. Our investigation was expanded to encompass JavaScript libraries employed within Chrome extensions, given that these libraries contain frequently reused code, potentially significantly influencing Chrome extension security. These libraries may be integrated as local files via copying or from a remote server. However, the source code of a JavaScript library is not invariably static; even identical versions may vary across different servers, and developers may modify the source code to meet specific requirements. Consequently, static methods are inadequate for reliable JavaScript library identification. Therefore, we employed dynamic detection to identify JavaScript libraries within Chrome extensions. By invoking the version retrieval APIs provided by these libraries when the JavaScript code is loaded in the Chrome browser, we were able to identify the library and its version. We examined 10 commonly used libraries to determine their presence within the imported JavaScript code. Our analysis detected 79291 library inclusions. Similar to the distribution of JavaScript inclusions, extension webpages contained the highest number of libraries, with only a small fraction imported from remote servers. JQuery was found to be the most prevalent library. Given that the frequency of other library inclusions was substantially lower than that of JQuery, and their analysis yielded similar results, we focus on presenting the JQuery analysis in this paper. We present the version distribution of JQuery and observe that developers typically update to the latest patch version. By calculating the age of the libraries relative to the extension’s update time, we determined that popular extensions tend to utilize older, outdated libraries. We also analyzed the prevalence of vulnerable library versions in Chrome extensions, finding that 21.88% of extensions still employ at least one vulnerable version of

Read the complete text