Morning everyone. Thank you so much for coming. I mean, I know this is the very first talk happening literally in every single screen out there. So really appreciate you making it out to ours. I'm Vivek Ramachandran. I have Shaurya with me. And we're going to talk about something very interesting, Sneaky Extensions, the MV3 escape artists. A little bit about me. I've been in cybersecurity 20 years. Very first DEF CON 2007 when I spoke, found multiple vulnerabilities, started multiple cybersecurity companies. Now we run SquareX, a browser native security company. Hello everyone. I'm Shaurya. I work as a principal software engineer at SquareX. My work mainly involves researching extensions, malicious extensions, and working on methods to actually tackle them. And we have Sasha from the Speaker Ops team. Okay, so browser extensions, I think almost everyone uses it. Anyone here doesn't use browser extensions? I'm guessing maybe in this audience, a few people are skeptical. But overall, I guess everybody uses browser extensions, good convenience feature. And that is really where I think our talk is about how easy it is for a browser extension to cause backdoors, a lot of attacks within your organization. And the grand finale is, we'll actually show you a browser extension which we've written, which can steal live calls on Google Meet, Zoom, and all of that while the call is happening, without having any indication that that MITM interception is going on. So, as I said, everybody uses extensions, Grammarly, 1Password, some of the more common ones. And now because of AI, every second day, you keep hearing about somebody offering a free extension, which gives you access to chat GPT premium, right? And then people just go about installing it, thinking they're getting free access. But many of those extensions are backdoored. Now, this problem is starting to compound. You know, some statistics from Forbes were over 280 million installs of extensions containing malware in just three years. Just 32 of them managed to go ahead and have a download count of over 75 million. I think a lot of folks think that the Chrome store does a lot of analysis, but it doesn't. It's very high level, very basic sanity checks and nothing more than that. And that's why this problem is starting to compound more and more year over year. So give it to Shourya to continue. So how many of you have ever written an extension before? Can you raise your hand? OK, so I'll just tell you all a little bit about how an extension code structure looks like. This will actually help us understand how the whole permission model is and how exactly people can leverage that against. So typically, any extension has these four things. So they have a manifest file. Then they have a service worker, which runs on the background. And then they have a content script. So content script is basically injected on whatever web page you're opening. Now, what all pages it is allowed to be present is specified in the manifest file. Lastly, some extensions also have an HTML page. So let's say you go ahead and click on an icon, you can see like a small pop-up will appear. So there's actually an HTML page. Similarly, some extensions can also have like a separate page, which you can access through your address bar by chrome-extension:// and specifying the extension ID. So this is what a typical extension structure looks like. Now, to understand how the whole permission model works, it's important to know two things. The first one is that, you know, in the extension, the very best thing that has been done is that you have to specify what all permissions are required, you know, upfront. So your manifest.json file itself specifies that what kind of permissions your extension is going to ask for. And this actually helps a lot as well. Now, after this, we also have this, a small, you know, a snippet. This snippet is actually a manifest file. So this is how it typically looks like. If you see on the top, this is where you specify the manifest version. So the current latest version is version 3. Now, you know, this has been actually a very, I would say, important transition as extensions are moving from version 2 to version 3. Because as you can see here, you know, earlier in the permissions, we had to specify a URL, like, you know, on this particular URL you have access to. But now it's much more clearer. So it's been broken up into further keys to bring much more clarity on how the permission is being handled. Now, if you look at the kind of permissions most of the extensions are asking for, here are some stats. So you can see that the third most is actually all URLs, which is quite, I would say, dangerous because most of your extension actually have access to modify any page if they want. Most people don't even read what the permission, you know, the prompt is saying to you. Now, the second important thing to know is how the whole process architecture inside the Chromium works like. So in Chromium, we have a multi-process architecture. So we have separate processes for doing separate things. For example, you know, if you have, like, a particular tab, so whatever you're seeing on the page is being done through a renderer process. Similarly, if there's a network call, it will actually happen through an entirely different process. So by having all these processes separated, you know, it really helps out in a security kind of point. The reason being that all these are basically isolated from the operating system point of view, because these cannot really, you know, interact at much other than the IPCs. Now, there is one more thing which is quite interesting. So every tab that you see is actually having a different renderer process, which actually further isolates them from interacting with each other. Now, you must be wondering, you know, what happens if there's an iframe on the page, right? So if a page has an iframe, it is further put in a different process. It's actually, I would say, a very big engineering milestone, because if you simply go to a web page and type, you know, a command F to find a text, it's actually searching that text across multiple processes. So it's quite an engineering feat, I would say. There are different terms for this, called a site isolation or site fission. Now, we'll come back to how the whole, you know, this architecture fits in. So this diagram basically shows it pretty well. So all the components which I showed you earlier, like extension pages, your content script, this is how the whole structure looks like. Now, content scripts are, I would say, the very first thing that we all should, you know, be careful about, because content scripts are injected on the web pages. Now, to see it in action, I'll actually show you a live code right now to see how exactly content scripts can modify a given page. So it's actually pretty straightforward. This is a typical extension. You can see, like, there's a manifest file. I'm just naming it test extension for now. And in this, I'm inserting a content.js file. So if you see here, there's a js file here, which is simply just going to write a text on the page. So, you know, if I go back to my browser, and let's say, you know, I try to load this specific extension. And if I disable it, now, if I try to access a website, let's say Google.com, it loads normally. But the moment I basically enable this test extension, and I try to open Google.com, it will get overwritten by whatever I have specified on the extension. Now, this is how basically content script works, like, you know, you have a way to inject something on the web page. Now, if you see this specific extension, there is no permission key here. And that's what makes it more dangerous, because, you know, I was able to modify a page, but I'm not actually asking for any explicit permission other than, like, in what pages I'm actually inserting the content script. So it's important not just to look at the permissions key, but also to look at, you know, in what particular pages the content script is being injected to. Now, coming back, one of the biggest problems that arise with this is actually remote code execution. So let's say, you know, I allow any of the extension to be installed on your browser, and later on, I'm sending some code from my server, which is definitely unmonitored. And I'm sending that code to execute on any random web page. Now, this is quite dangerous. So to avoid this, a lot of changes were done in the mv3 version itself. So we have these functions like eval, where, you know, you can specify, like, any kind of JavaScript code, and it executes on a given page. So all these things were banned in the mv3, at the same time also enforced to be blocked using the content security policy that is CSP. However, there are ways to bypass this as well. So, you know, just to give a small example of this, if I go back and look at the very same extension which I just showed you, and if I try this with, you know, just an eval, now this is how eval looks like, you know, you're sending a string, and this string is going to execute on the page. If I go back to my browser, and I try to, you know, reload my extension, and if I refresh now, the page will load normally. The reason being that it has been blocked because of the CSP policy. However, JavaScript is a funny language, so you can actually access the object, the functions, like normal arrays or objects as well. So if I go down and I write simply something like this, like, you know, so I specify my write within the square brackets, and the argument in a simple string, it'll actually work as well. So if I go back, and I, you know, basically try to refresh my extension, and if I go back, this will again show me back hello from extension. Now as you can see, all these two things were simple strings, and this can actually be leveraged to further send those strings from an external server as well. And this can also be used to in fact, you know, change the URL as well. So if you see the snippet here, this will simply change the location of a given page. Now, you know, the same thing can be extended by connecting this to a server as well. So if you see here, I have a simple Flask server, which just returns two things. One is a function name, and the other one is just an argument. So if I run this server right now, so I have my Flask server running, and I'll simply go back, and I will load the other extension, which has an integration with this API. Now, if I try to access a page, it still works, and you can see a hello from server is written there. Reason being, that if you look at the code of this extension, it is making an API call, getting what the function name is, getting what the argument is, and simply using it to change the content of the page. So, I think, you know, given the talk time is limited, we'll start with some demo videos as well. I think we have 10 minutes on the clock. 10 minutes? Okay. So, the very first demo we want to show is, I mean, there are a bunch of them, is social engineering, where you could literally, once you install an extension, it could pretend to go ahead and let's say drop a Zoom update, right? Because it's so common that you try to access Zoom and it says, go update. And Shauri will show you that. So, we can see here that, you know, I'm simply opening the Zoom website, and it looks like, you know, a normal Zoom website, how it's supposed to be. If I go ahead and enable this malicious extension, it's simply using a content script to add another object on that specific page, which says, hey, there's an update now. And the moment you click on this, you download a file. And if you see here, the download we are triggering is actually a blog-based download. So, even if you go to the downloads and you look at the URL, you will see it as, you know, it's coming from zoom.us. But actually, it was shipped with the extension. Now, if we simply open that execute table, it might affect your computer. The key thing to realize over here is, extensions have the power to run in the context of whichever page that they're injecting into. So, if you install a random extension, which says it's a color picker, and then you open zoom.us, at that point, it can actually inject into that page. And anything which happens from the browser's perspective is in the context of the page. So, if a file download is triggered, you feel it's probably from, you know, the actual Zoom website. Now, one interesting demo he'll actually show you is something live. Okay. And while he's getting that ready, imagine you have an extension and now you're doing a video call, right? How many of you end up using the browser version of Zoom and Google Meets and whatnot? Now, you might actually imagine that when a Google Meet call is actually happening, nothing else can monitor. So, we'll show you a demo of an extension which we've created, which while a live call is happening, it can go ahead, do a side monitoring, and literally get the entire feed of the call live and send it wherever, with zero indication in the Google Meet session that something is intercepting or monitoring this. So, as you can see here, you know, I'm basically gonna open Google Meet. We hope the internet connection works, or else we'll show you a very quick video. Okay, we have five minutes on the clock while he's getting it. The key thing to realize is, you can actually host a Chromium extension or an Edge extension, much of the times there is barely any security checks, which are really happening. So, if you see a featured extension, it isn't that, you know, Google's team has looked at the code, run a bunch of tests. Unbelievably, even in the enterprise version, some of the basic stuff that they end up showing, doesn't really look at what that code could do. Now, here's the worst part. We all fear download and execs, right? Because you run the stub, get something, that's something extensions can do right off the box. Is the extension just loads, looks innocent, but it can actually bring back foreign code and run it. So, if you see here, we are starting a new Google Meet session. Now, the malicious extension is installed. So, we're going to simply open, you know, another window and open an extension page to see what's actually seen. And you can see, like, you know, the live feed from that particular Meet page is being transferred to the other page. And that shows a lot, because, you know, having a simple host permission, it was not even a specified permission, you were actually able to steal a live stream from a given Meet page. So, the key thing to realize is, you know, extensions have superpowers. Just like, you know, an endpoint security, you end up installing something in kernel mode and that has one privilege level above what user space processes have. Similarly, extensions are sitting one level above, you know, the page itself. Yeah. We'll also look at just two quick demos right now. Another one is called silent account hijacking. So, in this, what I'm going to do is I'll simply have a malicious extension installed. And what it's going to do is that in the background, it's going to log into your GitHub account, because extensions have a highly privileged. So, they have access to all HTTP only cookies as well. And if you're doing it from your service worker, that is from your background, you don't even have to ask for explicit permission for accessing cookie as well. If you're simply making a fetch call instead of, you know, just getting the cookie value. So, in this demo, we can see that we have a demo GitHub account and I have a private repo here. In this private repo, if we go to the settings and look at the collaborators, right now, there are no additional collaborators in this repo. Now, what I'll do is I'll simply go and start the malicious extension. Now, if you see, nothing really happened and for a very small moment, a small tab just opened and closed automatically. Now, if I go back and check that specific repo back again, go to the settings and see who all are the collaborators. Then I will see that there's one more collaborator added here now. So, this just shows, you know, how sneaky they can be and they can actually also take over your private repos. And the best way to think about it is think about any form of browser automation with things like Selenium, which some of you may have done. With an extension, it can just do literally everything in the background, act on your behalf, go through complex workflows, anything the, you know, author would have probably baked into it. And some of these can just download at payloads and happen at runtime. Doesn't need to be at, you know, extension, compile or upload time to the Chrome store. Yeah, now we look at one more, which is interference with password managers. So, many people often use extensions for, you know, using, saving their password and using them. So, actually other malicious extension can interfere with that as well. So, in this example, we can see that a user is using one of the password manager vendors. And if you go to, let's say, a random SaaS application where you were already using that specific password manager, we can see that the password manager works and a person is, you know, able to log in normally how it's supposed to be. However, the moment if we go back and enable the malicious extension, what this extension will do is that it will override what the default action of clicking on that icon was. So, if we can see here, it's still the password manager's icon. But the moment I click on this, it will take me to another login page. So, for the test purpose and for demonstration, we have just named our extension with a malware word so that you know that this page is actually, you know, a fake one. But, you know, looking at the URL, you can't really figure that out. So, here, a person will then, you know, think that they might have logged out of their password manager and they will end up ending their credentials. And the moment they do that, they will get phished. So, we've run out of time. I think if you're interested, all the source code, everything we have here, you can go to sqrx.com. We'll put all of that up. We'll also put up a much more detailed video. We only got 20 minutes. We have a lot of research. Now, the key summary is even known extensions on the Chrome store get bought out all the time. And what attackers have started doing is if an extension has 100,000 installs, they'll just offer $10,000 to the author and they can transfer over ownership. And that means, you know, extensions you trusted could now automatically be untrusted. And a bunch of other supply chain attacks which can kind of happen in the context of the Chrome store, right? Thank you so much. And, yeah, please visit sqrx.com for more. Thank you.