Plug and Prey Scanning and Scoring Browser Extensions
Nishant Sharma (Head of Cyber Security Research · Square)
Recon Village @ DEF CON 33 · Day 1 · Recon Village
Overview
In an increasingly browser-centric digital landscape, browser extensions have emerged as a significant and often underestimated attack vector, transforming the traditional "endpoint" from the physical machine to the browser itself. The talk "Plug and Prey Scanning and Scoring Browser Extensions," presented by Nishant Sharma and Shya Prattab Singh from Square, delves into the critical need for robust security mechanisms to identify and mitigate risks posed by these ubiquitous mini-applications. They unveil a sophisticated, multi-pronged framework designed to scan, score, and ultimately categorize browser extensions as benign, risky, or malicious, addressing the current gaps in enterprise security.

Key moments
- 0:00 Talk Introduction and Speaker Background
- 2:46 Defining Browser Extensions and Their Growing Importance
- 4:05 Real-World Impact: Malicious Extensions and Supply Chain Attacks
- 5:59 Deep Dive: Understanding Browser Extension Structure
- 7:07 The Critical Manifest File and Declared Permissions
- 8:00 Extension Architecture: The "Isolated World" Concept
Plug and Prey Scanning and Scoring Browser Extensions
Speakers: Nishant Sharma, Head of Cyber Security Research, Square; Shya Prattab Singh, Principal Software Engineer, Square
Conference: Recon Village
YouTube: https://www.youtube.com/watch?v=WH6QRkoDlhk
Overview
In an increasingly browser-centric digital landscape, browser extensions have emerged as a significant and often underestimated attack vector, transforming the traditional "endpoint" from the physical machine to the browser itself. The talk "Plug and Prey Scanning and Scoring Browser Extensions," presented by Nishant Sharma and Shya Prattab Singh from Square, delves into the critical need for robust security mechanisms to identify and mitigate risks posed by these ubiquitous mini-applications. They unveil a sophisticated, multi-pronged framework designed to scan, score, and ultimately categorize browser extensions as benign, risky, or malicious, addressing the current gaps in enterprise security.
The presentation highlights how even seemingly innocuous or widely adopted extensions can be abused in the wild, turn malicious post-installation, or become vectors for sophisticated supply chain attacks. With over 90% of modern work conducted within the browser, and millions of users installing extensions, the potential for widespread compromise is immense. Sharma and Singh argue that current extension analysis methods lag significantly behind malware detection, necessitating a paradigm shift that integrates advanced static and dynamic analysis techniques, aided by artificial intelligence and machine learning.
This article provides a detailed exploration of their proposed framework, dissecting its technical pillars, the methodologies employed for scanning and scoring, and practical demonstrations of its efficacy. It underscores the urgency for organizations to re-evaluate their browser security postures and adopt proactive strategies to defend against the evolving threat landscape presented by browser extensions.
Background
▶ Watch: Talk Introduction and Speaker Background (0:00)
The shift in the enterprise attack surface is undeniable. Historically, the endpoint was synonymous with the physical machine, vulnerable to file-based malware. However, as noted by the speakers, over 90% of daily work, and potentially 99% excluding developers, now occurs within the browser (4:00). This transformation has made the browser the "new endpoint," attracting malicious actors who have pivoted their attack strategies accordingly. Browser extensions, small applications running within the browser, have become a prime target due to their pervasive use and privileged access.
The scale of the problem is staggering. News references cited in the talk indicate that by 2014, nearly 280 million installs of Chrome extensions led to widespread user compromise (4:00). More recently, in 2023 alone, Google removed approximately 32 malicious extensions from its store, which had collectively accumulated an astounding 75 million downloads (4:30). These figures underscore the vast reach and potential impact of malicious extensions. The threat is not merely theoretical; recent events include the proliferation of spyware extensions designed to exfiltrate user data and significant supply chain attacks, where legitimate companies' extensions have been compromised, leading to the malicious distribution across numerous enterprise endpoints (5:00). This demonstrates that a single vulnerability can have cascading effects throughout an organization.
Understanding the internal structure of an extension is crucial for analysis. Every extension consists of several key components (6:00):
- Manifest File: A JSON file (
manifest.json) that defines the extension's metadata, permissions, and other critical configurations (7:00). - Service Worker: A background script that runs independently of any specific web page, handling events and persistent tasks.
- Content Script: JavaScript code injected into web pages, allowing the extension to read and modify the DOM (Document Object Model) of the page.
- Pop-up or HTML Pages: Dedicated user interface elements that appear when the extension icon is clicked or as standalone pages.
Extensions are distributed as CRX files, which are essentially zip archives. Unzipping a CRX file reveals these internal components, providing a starting point for static analysis. A fundamental security mechanism for extensions is the concept of predeclared permissions. Developers must explicitly state all permissions an extension requires within its manifest file, adhering to the principle of least privilege (10:00).
However, this permission model presents a significant challenge. The isolated world architecture (8:00) ensures that an extension's content scripts run in a separate JavaScript environment from the page's scripts, preventing variable conflicts and some forms of interference. Despite this, both can access the DOM. More critically, many legitimate extensions require broad permissions. For instance, a popular grammar checker like Grammarly needs host permissions to read and modify content on "every page" (10:00), making it difficult to discern malicious intent based on permissions alone. The context of the extension's purpose is paramount; a "cookie editor" extension requesting cookie permissions might be justifiable, whereas an "AI assistant" extension requesting the same permission raises immediate red flags (11:00). This nuance highlights the inadequacy of simplistic permission-based security assessments.
The speakers assert that the current state of browser extension analysis is akin to malware detection 15 years ago – nascent and reactive (12:00). There's a pressing need for a more comprehensive and proactive approach to identify and mitigate the risks associated with extensions, especially those that are benign initially but turn malicious through updates or ownership changes.
Key Findings
▶ Watch: Real-World Impact: Malicious Extensions and Supply Chain Attacks (4:05)
The central contribution of this talk is the introduction of a comprehensive, multi-pillar framework for the automated scanning and scoring of browser extensions. This framework moves beyond the limitations of traditional static analysis and permission-based checks, which are often insufficient to catch sophisticated, runtime-activated, or supply chain attacks. The core finding is that a holistic approach, combining various analytical techniques and leveraging advanced AI/ML capabilities, is essential to accurately classify extensions as benign, risky, or malicious.
The framework's key contributions and findings include:
- Multi-Dimensional Analysis: The development of a system that integrates six distinct analytical pillars: permission analysis, metadata analysis, code analysis, composition analysis, dynamic analysis, and delta analysis (23:00). This layered approach provides a more complete security posture than any single method.
- Context-Aware Risk Scoring: The realization that permissions and code must be evaluated within the context of an extension's stated purpose. The framework incorporates logic to justify or question permissions based on the extension's functional description, moving beyond a generic severity assessment (11:00).
- AI/LLM-Driven Insights: The innovative application of AI agents and Large Language Models (LLMs) for both static code analysis and dynamic behavioral simulation (16:00, 21:00). This enables more intelligent code understanding, logical reasoning for verdicts, and realistic user interaction emulation, addressing obfuscation and runtime-dependent malicious logic.
- Dynamic Behavioral Emulation: The creation of a modified Chromium fork that acts as a Man-in-the-Middle (MITM) proxy within the browser environment (19:00). This allows for deep inspection of API calls and network traffic, crucial for detecting malicious activities that only manifest at runtime and would bypass static checks.
- Continuous Monitoring and Delta Analysis: The recognition that extensions can change ownership or be updated with malicious code. The framework includes automated delta analysis to detect changes between versions, providing an early warning system for compromised or "turned rogue" extensions (15:00, 22:00).
- "Risky" Classification: The introduction of a "risky" category (13:00) in addition to benign and malicious. This acknowledges that some extensions, while not overtly malicious, possess capabilities (e.g., broad permissions, obfuscated code) that could be exploited or indicate potential future compromise, providing enterprises with a nuanced risk assessment.
In essence, the key finding is that effective browser extension security requires a continuously evolving, automated, and intelligent framework capable of understanding an extension's intent and behavior across its lifecycle, from installation to updates, thereby protecting the browser as the modern-day critical endpoint.
Technical Deep Dive
▶ Watch: Deep Dive: Understanding Browser Extension Structure (5:59)
The proposed framework for scanning and scoring browser extensions is built upon six interdependent pillars, each contributing to a comprehensive risk score. This modular design allows for a nuanced evaluation, culminating in a verdict of benign, risky, or malicious.
1. Permission Analysis
The initial layer of defense involves scrutinizing an extension's declared permissions. While fundamental, the speakers emphasize that a simple severity ranking of permissions is insufficient. The critical component is context-aware justification (11:00). For example, an extension designed as a "cookie editor" might legitimately request permissions to access and modify cookies. However, an AI-powered productivity extension requesting the same permission would be flagged as suspicious. The system evaluates the requested permissions against the extension's stated purpose and description, flagging inconsistencies that indicate potential misuse.
2. Metadata Analysis
This pillar extracts and analyzes publicly available information about the extension and its developers (14:00):
- Installation and Review Metrics: High download counts coupled with negative sentiment in reviews or keywords suggesting unexpected behavior (e.g., "not doing what it promises") can be indicators of concern.
- Author Information: Analysis extends to the developer's provided address, attempting to determine if it's a legitimate commercial address or a suspicious residential one.
- Domain and Email Analysis: WHOIS lookups on associated domains and email addresses reveal their age and registration history. A newly registered domain for an established extension, or a frequent change in domain ownership, can signal a takeover or a sale on the secondary market (15:00), where legitimate extensions are bought and then weaponized. This continuous delta monitoring for ownership changes is crucial given the lack of transparency in official stores.
3. Code Analysis (AI/LLM-based)
Moving beyond traditional Static Application Security Testing (SAST) tools, this framework leverages AI agents and LLMs to understand the extension's source code (16:00). The manifest file, background.js (for service worker logic), and content.js (for content script logic) are fed into the LLM. Unlike SAST, which primarily looks for known patterns or vulnerabilities, the LLM is designed to comprehend the intent of the code. It can provide a logical reasoning for its findings, explaining why a particular piece of code might be considered risky or malicious based on its contextual understanding of the extension's purpose. This approach is particularly effective at identifying subtle malicious logic that might be missed by signature-based tools.
4. Composition Analysis
This pillar examines the structural makeup of the extension's codebase (18:00):
- Obfuscated Code and WebAssembly (WASM): The presence of significant amounts of obfuscated JavaScript or compiled binaries like WebAssembly (WASM) is a major red flag. While some legitimate applications use these for performance or intellectual property protection, a high proportion within an extension, especially without clear justification, suggests an attempt to hide malicious functionality.
- File Metrics: The number and types of files, their sizes, and distribution are analyzed to detect anomalies. For instance, an extension with an unusually large number of binary files for its stated function would raise suspicion.
5. Dynamic Analysis (AI Agents + Modified Chromium)
This is arguably the most powerful component, designed to catch malicious behaviors that only manifest at runtime and evade static detection (18:00).
- Limitations of Static Analysis: Many sophisticated extensions employ techniques like fetching instructions from a remote URL at runtime, utilizing Domain Generation Algorithms (DGAs), or activating malicious payloads only under specific user interactions or conditions. Static analysis tools are blind to these.
- Modified Chromium Fork as MITM Proxy: To overcome these limitations, the team developed a custom Chromium fork that acts as an integrated Man-in-the-Middle (MITM) proxy (19:00). Because the proxy operates within the browser's process, it can transparently intercept all API calls made by the extension and all network traffic (requests and responses) without encountering SSL interception issues common with external proxies. All intercepted data is time-stamped for correlation.
- AI Agent Emulation: A critical aspect is the use of an AI agent that emulates realistic user activity (20:00). Many malicious extensions are designed to lie dormant until a real user performs specific actions. The AI agent, informed by the extension's context, generates a dynamic profile of simulated interactions. This ensures that the extension's full behavioral spectrum is observed.
- Timeline Correlation and LLM Verdict: The API logs, network logs, and AI agent action logs are all correlated into a single timeline. This integrated data stream is then fed to an LLM, which analyzes the sequence of events and provides a verdict, explaining why certain behaviors are deemed malicious (21:00). This "reaction to your actions" approach uncovers hidden malicious functionality.
6. Delta Analysis
Given the frequent updates to extensions (hundreds or thousands daily), continuous monitoring for changes is crucial (22:00).
- Automated Update Tracking: When an extension is updated, the system automatically retrieves the new version.
- Code Diffing: Similar to tools like Git, the system performs a diff comparison between the old and new codebases, highlighting additions, deletions, and modifications.
- AI-Powered Change Evaluation: These changes are then fed to an AI agent, which evaluates if the new code introduces risky permissions, suspicious external calls, obfuscated logic, or any other malicious behavior. This catches instances where a benign extension "goes rogue" after an update or ownership change.
Scoring Mechanism
Each of these six modules contributes a weighted score to the overall risk assessment (24:00). The aggregated score determines the final classification: benign, risky, or malicious. This weighting allows for flexibility and fine-tuning based on the perceived importance of different indicators. The speakers acknowledge that no security solution is a "silver bullet" (23:00) and that sophisticated attackers might attempt to bypass the framework, but its broad applicability targets the vast majority of threats and can be continuously evolved.
Demo / Proof of Concept
▶ Watch: The Critical Manifest File and Declared Permissions (7:07)
The speakers provided a live demonstration of their platform, showcasing its capabilities through two distinct examples: a benign extension and a malicious one (24:00).
Example 1: Benign Extension Analysis
The first part of the demo walked through the analysis of a typical, presumably benign, extension.
- Metadata View: The platform's initial display focused on metadata. It showed the extension's permissions and, crucially, provided a justification for each permission based on the extension's purpose. For instance, it explained why a specific permission was deemed necessary or unnecessary for that particular use case. The demo also featured a visual component, plotting the developer's registered address on a map (e.g., Google Earth Street View), allowing for a quick check on whether the location appeared commercial or suspicious (24:00-25:00).
- Code and Composition Analysis: The interface then transitioned to the code analysis section, displaying the LLM's assessment of key files (like
content.jsandbackground.js) along with its reasoning for the verdict. This was followed by composition analysis, which detailed the types and numbers of files within the extension, highlighting any obfuscated components or WebAssembly (25:00). - Dynamic Analysis Logs: The most illustrative part was the dynamic analysis output. This included detailed logs of API calls made by the extension, network traffic (requests and responses), and a log of actions performed by the AI agent during its simulation. The speaker demonstrated how these logs provided a chronological record of the extension's runtime behavior. Based on this comprehensive data, the platform confidently marked the extension as benign (25:00-26:00). The demo also clarified that the dynamic analysis supports three simulation types: "zero simulation" (install only), "static activity" (predefined actions), and "agentic simulation" (context-aware, tailor-made user emulation) (26:00).
- Delta Analysis: Finally, the platform showed the delta analysis capabilities, presenting a change log between versions. This feature allows security analysts to quickly review modifications, search through new code, and identify potential vulnerabilities or new risky behaviors introduced in an update (26:00).
Example 2: Malicious Color Picker Extension
The second, more compelling example demonstrated the framework's ability to detect a malicious extension that had previously "gone rogue" in the wild (27:00).
- The Scenario: This was a widely used color-picking extension, boasting over 100,000 installs, which was initially benign but later updated with malicious functionality.
- Malicious Behavior: The updated version transformed the extension into spyware. It began reporting every page the user opened to its command-and-control (C2) server. Additionally, it incorporated a feature allowing the attacker to remotely send a URL, which the extension would then open for the user, potentially leading to phishing or malicious redirection, leveraging its contextual awareness (e.g., knowing the user is on Facebook to craft a convincing redirect) (27:00-28:00).
- Dynamic Analysis Catches the Threat: The demo vividly showed how the dynamic analysis caught this stealthy behavior. The AI agent, simulating user activity, opened legitimate sites like GitHub and Google. Crucially, the network logs and browser automation logs clearly showed the extension reporting these page navigations to an external, suspicious domain – its C2 server (28:00).
- LLM Verdict: By correlating the agent's actions with the extension's network communications, the LLM was able to definitively classify the extension as malicious and specifically identify it as spyware, providing detailed reasoning for its verdict (28:00). This example powerfully illustrated how the dynamic, AI-driven approach can uncover sophisticated runtime-activated threats that would likely bypass static analysis.
The demonstration effectively validated the multi-pillar framework, showcasing its practical application in distinguishing between benign, risky, and malicious browser extensions.
Defensive Implications
▶ Watch: Extension Architecture: The "Isolated World" Concept (8:00)
The insights presented by Nishant Sharma and Shya Prattab Singh offer critical guidance for organizations aiming to bolster their cybersecurity defenses against browser extension threats. The defensive implications span policy, technology, and operational practices:
- Shift from Reactive Blocking to Proactive Analysis: Enterprises can no longer rely solely on blocking known malicious extensions or enforcing blanket policies. A proactive, continuous analysis framework is essential. This means moving beyond simple whitelisting/blacklisting towards a system that actively scans and scores all extensions, even seemingly benign ones (12:00).
- Implement Context-Aware Permission Evaluation: Organizations should train their security teams and, ideally, integrate automated tools that evaluate extension permissions not just by severity, but by their justification relative to the extension's stated function (11:00). An AI extension asking for cookie permissions should be treated differently than a dedicated cookie editor.
- Prioritize Dynamic and Behavioral Analysis: Static analysis is demonstrably insufficient. Defenders must invest in solutions that can perform dynamic analysis by emulating user behavior within a controlled environment. The concept of a modified Chromium fork acting as a MITM proxy (19:00) is a powerful technique for intercepting API calls and network traffic, revealing runtime-activated malicious behavior.
- Leverage AI and LLMs for Scalable Security: The sheer volume of extensions (150,000+ in Chrome store) and their frequent updates necessitates automation (22:00). Organizations should explore integrating AI agents and LLMs into their security operations for scalable code analysis, behavioral simulation, and intelligent verdict generation, moving beyond traditional SAST tools.
- Establish Continuous Monitoring for Extension Updates: The "benign to malicious" pivot demonstrated by the color picker extension highlights the critical need for delta analysis (22:00). Security teams must have mechanisms in place to automatically re-evaluate extensions upon every update, identifying any new, risky, or malicious code introduced. This also applies to monitoring for changes in ownership or associated developer metadata (15:00).
- Define Policies for "Risky" Extensions: The introduction of a "risky" category (13:00) is significant. Enterprises should develop clear policies for how to handle extensions that, while not overtly malicious, exhibit characteristics like broad permissions, significant obfuscated code, or a history of developer changes. These might require additional scrutiny or be restricted to specific user groups.
- Educate Users on Extension Risks: While technical controls are paramount, user education remains a crucial defense layer. Users should be aware of the permissions extensions request, the importance of developer reputation, and the potential for even popular extensions to be compromised.
- Consider Supply Chain Security for Extensions: The risk of supply chain attacks through compromised legitimate extensions (5:00) means that vendor risk assessments should extend to the browser extensions used by employees, especially those integrated with critical business applications.
By adopting these defensive strategies, organizations can significantly enhance their posture against the increasingly sophisticated and pervasive threats posed by browser extensions, securing the browser as the new, critical endpoint.
Key Takeaways
- Browser Extensions are the New Endpoint Malware: With the majority of work now performed in browsers, extensions have become a primary attack vector, necessitating advanced security measures akin to traditional endpoint protection.
- Static and Permission-Based Analysis is Inadequate: Relying solely on declared permissions or static code scans is insufficient to detect sophisticated threats like runtime-activated malware, obfuscated code, or extensions that turn malicious post-update. Context-aware evaluation is paramount.
- A Multi-Pillar Framework is Essential: Comprehensive extension security requires a layered approach combining permission analysis, metadata scrutiny, AI-driven code analysis, composition analysis, dynamic behavioral emulation, and continuous delta analysis.
- AI and LLMs are Game-Changers for Scalability and Intelligence: Leveraging AI agents for realistic user simulation and LLMs for contextual code understanding and logical verdict generation is critical for analyzing the vast and frequently updated landscape of extensions.
- Dynamic Analysis via Modified Browser Environments Uncovers Hidden Threats: A custom Chromium fork acting as an internal MITM proxy, combined with AI-driven user emulation, provides unparalleled visibility into an extension's runtime API calls and network traffic, catching behaviors missed by static methods.
- Continuous Monitoring Detects "Rogue" Extensions: Automated delta analysis and metadata monitoring for ownership changes are vital to detect when legitimate extensions are compromised or updated with malicious functionality, protecting against evolving supply chain attacks.
About the Speaker(s)
Nishant Sharma is the Head of Cyber Security Research at Square, focusing on browser security, specifically web extensions. With a decade of experience in cybersecurity education, he previously served as VP of labs in R&D at IME (known for certifications like eGPT) and was with Pentest Academy. Nishant is a seasoned speaker, having presented at major security conferences including Defcon (mainstage and creative stage), Black Hat EU, and conducted workshops at events like the Texas Cyber Summit. His current work at Square involves building shared security-focused extensions and researching methods to counter web security risks.
Shya Prattab Singh is a Principal Software Engineer at Square, where he specializes in browser security and web extensions. He is responsible for building shared security-focused extensions at Square and conducts research into mitigating web security risks. Shya has also presented his work at prominent conferences, including Defcon (both mainstage and creative stage) and Black Hat EU, and has conducted workshops at other cybersecurity events. He is deeply involved in the company's "Year of Browser Bugs" initiative, which focuses on identifying and addressing browser-related security vulnerabilities.
Reviews
Dr. Zero (Offensive Security Researcher) — SOLID
Competent engineering talk that builds a sensible multi-layer pipeline for browser extension analysis — the modified Chromium MITM approach and LLM-driven delta analysis are the genuinely interesting bits. Ultimately reads as a product demo for an internal Square tool dressed up as research, and the novelty ceiling is low given how much of this space has already been covered by academic work and commercial players like Spin.AI and LayerX.
Heather Calloway (CISO) — SOLID
Sharma and Singh identify a real and underserved problem — browser extensions as a persistent, scalable enterprise attack vector — and their multi-pillar framework is technically credible. The talk earns its keep as practitioner-level security research, but it stays inside the engineering layer and never reaches the governance or program decisions that would make it matter to a CISO.