EmPoWeb: Empowering Web Applications with Browser Extensions

Dolière Francis Somé

TL;DR

This paper introduces EmPoWeb, a novel static analysis tool designed to identify security and privacy vulnerabilities in browser extensions. It reveals how extensions, by design, can bypass the Same Origin Policy and be exploited by web applications to access sensitive user data, download files, and even execute arbitrary code.

What Problem Does This Paper Address?

Browser extensions are powerful tools that enhance user experience by extending browser functionality. However, their privileged access to user data and browser APIs, coupled with their ability to communicate with web applications, creates a significant security and privacy risk. Unlike web applications, extensions are not bound by the Same Origin Policy (SOP), allowing them to access data from any website. This paper addresses the critical gap in understanding how web applications can exploit vulnerabilities in browser extensions to gain unauthorized access to sensitive user information and perform malicious actions. The authors aim to quantify the scale of this threat and propose solutions to mitigate it.

Methods

The core of this research is a static analysis tool developed to identify how browser extensions communicate with web applications via message passing interfaces. The tool works by:

  • Unpacking Extensions: Downloading and unpacking extension code.
  • Building ASTs: Parsing JavaScript code into Abstract Syntax Trees (ASTs) to analyze its structure.
  • Identifying Message Handlers: Locating functions that handle messages from web applications.
  • Analyzing Sensitive API Calls: Detecting calls to privileged APIs within these message handlers that could be exploited.
  • Manual Review: A crucial step where suspicious extensions identified by the static analyzer are manually reviewed to confirm vulnerabilities and understand exploitability.

This methodology allows for a large-scale analysis of extensions and a deep dive into the specific vulnerabilities.

Datasets

The study analyzed a large corpus of browser extensions:

  • Chrome: 66,401 extensions
  • Firefox: 9,391 extensions (specifically WebExtensions API)
  • Opera: 2,523 extensions

This dataset represents a significant portion of available extensions at the time of the study. The authors also provide online resources, including the tool and videos demonstrating exploits, which can serve as a benchmark for future research.

Key Insights and Ideas

  • Extensions as a Bridge: Extensions act as a powerful bridge, allowing web applications to bypass SOP and access privileged browser features they would otherwise be denied.
  • Trivial Exploits: Many of the identified vulnerabilities are exploitable through simple, straightforward messages, suggesting that these issues might be deliberate or a result of poor programming practices rather than complex attack vectors.
  • Cross-Browser Compatibility Risks: The same extension code across different browsers can lead to a situation where a vulnerability is fixed on one platform but persists on another, creating an inconsistent security posture for users.
  • Developer Tools as a Threat Vector: While developer tools are often seen as benign, the study found extensions in this category that pose significant security risks.
  • Popular Extensions are Vulnerable: A substantial portion of the identified vulnerable extensions have thousands of users, indicating a widespread potential impact.

Key Results

The static analysis tool flagged 3,996 extensions as suspicious across Chrome, Firefox, and Opera. Manual analysis confirmed that 197 unique extensions pose various security and privacy threats. These extensions can be exploited by web applications to:

  • Bypass SOP: Access user data on any web application (63 extensions).
  • Read Cookies: Steal user credentials, enabling session hijacking (19 extensions).
  • Execute Arbitrary Code: Run malicious code within the extension's context (19 extensions).
  • Trigger Downloads: Download malicious software onto the user's device (36 extensions).
  • Access Sensitive Data: Read browsing history, bookmarks, and installed extension lists (38 extensions).
  • Store/Retrieve Data: Utilize extension storage for tracking purposes (90 extensions).

Limitations and Future Work

The authors acknowledge several limitations:

  • Focus on Packaged Scripts: The analysis primarily focused on scripts bundled within extensions, not external scripts that extensions might reference.
  • Static Analysis Limitations: The static analyzer has limitations, including not fully considering JavaScript scopes, which could lead to false positives (mitigated by manual review) and potentially false negatives due to the flexibility of JavaScript.
  • Manual Analysis Challenges: Manually analyzing complex, minified, or obfuscated JavaScript code can be time-consuming and challenging.
  • Uncertainty for Some Extensions: For a small number of extensions, the analysis could not definitively conclude potential threats.

Future work could involve:

  • Improving Static Analysis: Enhancing message passing listener extraction and tracking of extension API escalations.
  • Expanding Threat Models: Incorporating more advanced extension threats from the literature.
  • Browser Vendor Collaboration: Working with vendors to implement more rigorous review processes, potentially mandating explicit declaration of web application interactions and exploring architectural changes to restrict message passing.

Summary updated

BibTeX
@inproceedings{some2019empoweb,
  author = {Dolière Francis Somé},
  title = {{EmPoWeb: Empowering Web Applications with Browser Extensions}},
  booktitle = {IEEE Symposium on Security and Privacy},
  year = {2019},
  doi = {10.1109/sp.2019.00058},
}
Figure