Insufficient data validation in Extensions (CVE-2025-0443)
The chrome.devtools API's canAccessResource check can be bypassed by overriding the URL.prototype protocol getter, allowing an extension to access local file contents despite the 'Allow access to file URLs' setting being disabled. An attacker could read local files if the user interacts with them in the sources panel.
- Fix shipped in 2 months
Steps to reproduce the problem
- Install the attached extension on macOS, and disable "Allow access to file URLs".
- Open devtools on the new tab opened by the extension.
- Edit the /etc/hosts file highlighted in the sources panel, and save the changes.
- Observe that extension pops up an alert with the new contents of this file.
Problem Description
Various APIs under chrome.devtools use the canAccessResource function (https://chromium.googlesource.com/devtools/devtools-frontend/+/refs/heads/main/front_end/models/extensions/ExtensionAPI.ts#1149) for checking if local resources should be accessible to a given extension. However, the checks in this function can currently be entirely bypassed by overriding URL.prototype's protocol getter as is done in the attached POC. Since there are no additional checks on the ExtensionServer side when adding event listeners through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener, an extension can gain access to local resources this way if the user interacts with such resources in the sources panel.
Additional Comments
Previous issues relating to this include:
Notably, the latter of those was fixed by https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4370246, which in turn introduced the possibility to modify the URL prototype to bypass this check.
Summary
Local file access restrictions in chrome.devtools can be bypassed through prototype manipulation.
Additional Data
Category: Security
Chrome Channel: Stable
Regression: N/A
Context
Chrome extensions can reach into DevTools through the chrome.devtools.* APIs. Several of those APIs expose local resources, such as files opened in the Sources panel, and the browser is supposed to gate that access on whether the extension is allowed to touch file URLs. The gate is a function called canAccessResource in the DevTools frontend, in ExtensionAPI.ts.
The report concerns a bypass of that gate. It was filed against Google Chrome through the Chrome VRP, rated medium severity, and paid a bounty of 1000.00 USD. It was disclosed on 2025-01-14 as CVE-2025-0443, under the weakness "insufficient data validation", with the asset listed as Extensions. The researcher is listed as anonymous.
Setup
The reproduction is on macOS. The only precondition stated is an installed extension that uses the DevTools APIs, with the extension's "Allow access to file URLs" setting turned off. That setting is the user-facing control the check is meant to enforce, so turning it off is what makes the bypass meaningful.
The report refers to an attached extension and an attached POC, but their contents are not included in the text available here.
Finding it
The researcher looked at how the DevTools APIs decide whether a local resource may be exposed to an extension. The relevant helper is canAccessResource, linked in the report at:
https://chromium.googlesource.com/devtools/devtools-frontend/+/refs/heads/main/front_end/models/extensions/ExtensionAPI.ts#1149
That function is used by various APIs under chrome.devtools to check whether local resources should be accessible to a given extension. The researcher found that the checks in it can be entirely bypassed by overriding URL.prototype's protocol getter, as done in the attached POC. In other words, the decision is made by reading a property off a URL object, and that property lives on a prototype that can be modified.
The second half of the finding is on the other side of the boundary: there are no additional checks on the ExtensionServer side when event listeners are added through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener. So once the frontend check is fooled, nothing further validates the access.
The report also places this in a line of earlier issues:
The second of those was fixed by https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4370246, and that fix, according to the report, introduced the possibility of modifying the URL prototype to bypass the check.
Exploitation
Step 1: install the extension with file URL access disabled
Install the attached extension on macOS, and disable "Allow access to file URLs". This puts the extension in the state the check is supposed to protect: it should not be able to read local files.
Step 2: open DevTools on the extension's tab
Open devtools on the new tab opened by the extension. The extension's DevTools integration is now active in that context.
Step 3: edit a local file from the Sources panel
Edit the /etc/hosts file highlighted in the sources panel, and save the changes. This is the user interaction the attack depends on: the user works with a local resource in the Sources panel.
Step 4: observe the leaked contents
The extension pops up an alert with the new contents of this file. The extension, which was not allowed to access file URLs, has received the content of a local file through the onResourceContentCommitted event.
The mechanism is the prototype override described above: by replacing the protocol getter on URL.prototype, the extension makes canAccessResource reach the wrong conclusion about the resource, and because the ExtensionServer performs no further validation when the listener is registered, the event fires with the local file's content.
Root cause
The checks in canAccessResource can be bypassed by overriding URL.prototype's protocol getter. Because URL.prototype can be modified, the checks in canAccessResource can be entirely bypassed for a resource the extension should not reach. The report states this plainly: the checks can be entirely bypassed by overriding URL.prototype's protocol getter.
The design gap is that when listeners are added through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener, the ExtensionServer side applies no additional checks. When a listener is added through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener, the ExtensionServer side applies no additional checks, so there is no second line of defence behind the bypassable one. The report notes that the earlier fix in change 4370246 is what introduced the possibility of modifying the URL prototype to bypass the check.
Impact
An extension that the user has explicitly denied file URL access can still obtain the contents of local files, provided the user interacts with such resources in the Sources panel. In the reproduction the file is /etc/hosts, and the content arrives through the onResourceContentCommitted event. The report's summary is that local file access restrictions in chrome.devtools can be bypassed through prototype manipulation.
The condition is the user editing and saving a local resource in the Sources panel while the extension is active.
Fix
The report does not describe a fix. It identifies the vulnerable function and the missing server-side validation, and links the earlier change that introduced the bypassable pattern.
Variants to test
- A positive result is an API returning data or firing an event for a resource the extension should not access.
- A positive result is content from a local file arriving in the extension.
- If a frontend-only check can be bypassed and the event still fires, the server side is not enforcing the restriction.
- A positive result is a check that can be made to return the wrong answer by redefining a getter.
Hunting notes
In browser extension and DevTools code, that means checks written in the frontend against URL, Location or similar objects, and any privileged event or API that trusts the frontend's conclusion without re-validating on the server side.
What happened, in plain words
Chrome extensions can be given extra powers to work with the browser's developer tools. Some of those APIs expose local resources, such as files opened in the Sources panel. Chrome has a setting called "Allow access to file URLs" that is supposed to control whether an extension can touch local files at all. When that setting is off, the extension should not be able to read local files.
This report shows that the check enforcing that setting can be fooled. The check is a function called canAccessResource in the DevTools frontend code. Its checks can be bypassed by overriding URL.prototype's protocol getter. Because JavaScript lets code change how built-in objects behave, an extension can override the protocol getter and bypass the checks. The report calls this "prototype manipulation".
There are no additional checks on the ExtensionServer side when the extension adds a listener for the onResourceContentCommitted event. So when the user edits and saves a local file in the Sources panel, the extension receives the new contents of that file, even though file URL access was disabled.
The report was filed against Google Chrome through the Chrome VRP, rated medium severity, and paid a bounty of 1000.00 USD. It was disclosed on 2025-01-14 as CVE-2025-0443, under the weakness "insufficient data validation", with the asset listed as Extensions. The researcher is listed as anonymous.
Background: what you need to know
Before walking through the steps, here are the pieces involved, explained from scratch.
Chrome extensions
A Chrome extension is a small program you install into the browser to add features, such as a password manager or a tool that changes how pages look. Extensions are written in JavaScript and run inside the browser, but they are not supposed to have unlimited access to your computer.
DevTools and the Sources panel
DevTools (developer tools) is the set of panels built into Chrome for inspecting web pages: you can see the page's HTML, its network requests, and its JavaScript. One of those panels is the Sources panel, which shows files the browser has loaded, including local files if you open them there. You can view and edit those files in the panel and save your changes.
The chrome.devtools APIs
An API (application programming interface) is a set of functions that one piece of software offers to another so they can talk to each other. Think of it as a menu of actions: the browser offers a menu of functions, and an extension can call them. The chrome.devtools.* APIs are the menu that lets an extension interact with DevTools. Some of those functions expose local resources, such as files opened in the Sources panel.
The "Allow access to file URLs" setting
This is a switch in the extension's settings page. When it is off, the extension is not supposed to be able to read files on your computer through the browser. The check in the code is meant to enforce that switch. Turning it off is what makes the bypass meaningful: without that setting, there would be nothing to bypass.
canAccessResource
The browser needs a way to decide whether an extension is allowed to see a particular local resource. In the DevTools frontend code, that decision is made by a function called canAccessResource. The report links to it here:
https://chromium.googlesource.com/devtools/devtools-frontend/+/refs/heads/main/front_end/models/extensions/ExtensionAPI.ts#1149
This is a URL pointing to a file in the Chromium source code repository. ExtensionAPI.ts is the file, and #1149 points to a particular line in it. The report says this function is used by various APIs under chrome.devtools to check whether local resources should be accessible to a given extension.
URL objects and prototypes
JavaScript has a built-in object called URL that represents a web address and lets code ask questions about it, such as what its protocol is (for example https: or file:). Every URL object inherits its behaviour from a shared template called a prototype (URL.prototype). If code changes that shared template, every URL object in that context sees the change. A property like protocol can be defined as a getter, which is a function that runs whenever someone reads that property. If an extension replaces the getter on URL.prototype, then any code that reads .protocol gets whatever the extension wants it to return.
A simple comparison: imagine a form where you tick a box to say "I am allowed in". The guard reads the box. If someone can replace the box with a fake one that always says "yes", the guard will let them through no matter what the real permission is. Overriding the protocol getter is like swapping the box.
The ExtensionServer and event listeners
Extensions and the browser communicate through messages. The ExtensionServer is the part on the browser side that handles these extension requests. An event listener is a piece of code that says "when this event happens, run this function". The event in this report is onResourceContentCommitted, registered through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener. The extension registers a listener for it through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener.
The report's second finding is that when that listener is added, the ExtensionServer side performs no additional checks. So the only gate is the frontend check, and that gate can be fooled.
The vulnerability class: insufficient data validation
The weakness is listed as "insufficient data validation". In plain terms, the code accepts data without checking it properly. Here, the checks can be bypassed by overriding URL.prototype's protocol getter.
Setup
The reproduction is on macOS. The only precondition stated is an installed extension that uses the DevTools APIs, with the extension's "Allow access to file URLs" setting turned off. That setting is the user-facing control the check is meant to enforce, so turning it off is what makes the bypass meaningful.
The report refers to an attached extension and an attached POC, but their contents are not included in the text available here.
Finding it
The researcher looked at how the DevTools APIs decide whether a local resource may be exposed to an extension. The relevant helper is canAccessResource, linked in the report at the URL shown above. That function is used by various APIs under chrome.devtools to check whether local resources should be accessible to a given extension.
The researcher found that the checks in it can be entirely bypassed by overriding URL.prototype's protocol getter, as done in the attached POC. In other words, the decision is made by reading a property off a URL object, and that property lives on a prototype the page context can modify.
The second half of the finding is on the other side of the boundary: there are no additional checks on the ExtensionServer side when event listeners are added through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener. So once the frontend check is fooled, nothing further validates the access.
The report also places this in a line of earlier issues:
The second of those was fixed by https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4370246, and that fix, according to the report, introduced the possibility of modifying the URL prototype to bypass the check.
Exploitation
Step 1: install the extension with file URL access disabled
Install the attached extension on macOS, and disable "Allow access to file URLs". This puts the extension in the state the check is supposed to protect: it should not be able to read local files.
Why this step: the whole point is to show that the restriction does not hold. If file URL access were left on, the extension would be allowed to read local files anyway, and there would be nothing to demonstrate.
Step 2: open DevTools on the extension's tab
Open devtools on the new tab opened by the extension. The extension's DevTools integration is now active in that context.
Step 3: edit a local file from the Sources panel
Edit the /etc/hosts file highlighted in the sources panel, and save the changes. This is the user interaction the attack depends on: the user works with a local resource in the Sources panel.
Why this step: the report's reproduction depends on the user editing and saving a local file in the Sources panel. Without the user editing and saving a local file there, the event does not happen, and the extension has nothing to receive. The report uses /etc/hosts as the local file in the demonstration.
Step 4: observe the leaked contents
The extension pops up an alert with the new contents of this file. The extension, which was not allowed to access file URLs, has received the content of a local file through the onResourceContentCommitted event.
The mechanism is the prototype override described above: by replacing the protocol getter on URL.prototype, the extension makes canAccessResource reach the wrong conclusion about the resource, and because the ExtensionServer performs no further validation when the listener is registered, the event fires with the local file's content.
Root cause
The checks in canAccessResource can be bypassed by overriding URL.prototype's protocol getter. Because URL.prototype can be modified, the checks in canAccessResource can be entirely bypassed for a resource the extension should not reach. The report states this plainly: the checks can be entirely bypassed by overriding URL.prototype's protocol getter.
The design gap is that when listeners are added through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener, the ExtensionServer side applies no additional checks. When a listener is added through chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener, the ExtensionServer side applies no additional checks, so there is no second line of defence behind the bypassable one. The report notes that the earlier fix in change 4370246 is what introduced the possibility of modifying the URL prototype to bypass the check.
Impact
An extension that the user has explicitly denied file URL access can still obtain the contents of local files, provided the user interacts with such resources in the Sources panel. In the reproduction the file is /etc/hosts, and the content arrives through the onResourceContentCommitted event. The report's summary is that local file access restrictions in chrome.devtools can be bypassed through prototype manipulation.
The condition is the user editing and saving a local resource in the Sources panel while the extension is active.
Fix
The report does not describe a fix. It identifies the vulnerable function and the missing server-side validation, and links the earlier change that introduced the bypassable pattern.
Variants to test
- A positive result is an API returning data or firing an event for a resource the extension should not access.
- A positive result is content from a local file arriving in the extension.
- If a frontend-only check can be bypassed and the event still fires, the server side is not enforcing the restriction.
- A positive result is a check that can be made to return the wrong answer by redefining a getter.
Hunting notes
In browser extension and DevTools code, that means checks written in the frontend against URL, Location or similar objects, and any privileged event or API that trusts the frontend's conclusion without re-validating on the server side.
Glossary
- API: a set of functions that one piece of software offers to another so they can communicate; a menu of actions.
- Bounty: a payment made by a company to a researcher who reports a security bug.
- Chrome VRP: Chrome Vulnerability Reward Program, Google's programme that pays for security reports about Chrome.
- CVE: a public identifier for a known security vulnerability.
- DevTools: the developer tools built into Chrome, including the Sources panel.
- Extension: a small program installed into the browser to add features.
- ExtensionServer: the part of the browser that receives messages from extensions.
- Event listener: code that waits for a particular event and runs a function when it happens.
- Frontend: the part of the code that runs in the browser's user-facing context, as opposed to the server side.
- Getter: a function that runs when a property is read, allowing code to compute the value on the fly.
onResourceContentCommitted: a DevTools event that fires when a resource's content is saved in the Sources panel.- POC: proof of concept, a small piece of code that demonstrates a vulnerability.
- Prototype: a shared template object in JavaScript from which other objects inherit properties and behaviour.
- Prototype manipulation: changing a shared prototype so that objects inheriting from it behave differently.
- Sources panel: the DevTools panel that shows files loaded by the browser, including local files, and lets you edit and save them.
URL: a JavaScript built-in object representing a web address.URL.prototype: the shared template for allURLobjects; changing it affects everyURLobject.canAccessResource: the DevTools frontend function that decides whether an extension may access a given resource.chrome.devtools.*: the set of APIs that let an extension interact with DevTools.chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener: the call an extension uses to register a listener for theonResourceContentCommittedevent.- Insufficient data validation: a weakness where code accepts data without checking it properly.
- Protocol: the part of a web address that says how to reach it, such as
https:orfile:. /etc/hosts: a system file on macOS that maps host names to addresses.- macOS: Apple's desktop operating system.