Skip to content
Access control Advisory Advanced CVE-2024-5836

Inappropriate Implementation in DevTools (CVE-2024-5836)

A race condition in the DevTools API server and insufficient permission checks allow an extension with the devtools_page permission to run arbitrary JavaScript on any privileged page, including chrome:// pages. An attacker could exploit this to bypass permissions and execute code on sensitive pages.

Allen Ding Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 22 days

As requested, I am submitting this as a separate issue. The original bug report (with the full chain leading to a sandbox escape) is located at https://issues.chromium.org/issues/338248595

Note that this bug was already fixed in the original issue. I was just asked to submit this as a separate report for tracking purposes.

VULNERABILITY DETAILS

A race condition in the devtools API server and chrome.devtools.inspectedWindow.reload, along with insufficient permissions checks, allows an extension with the devtools_page permission to run arbitrary JS on any privileged page.

EXPLANATION

The chrome.devtools.inspectedWindow.reload function has no checks to see if the extension is actually allowed to execute scripts on the inspected page. The only thing preventing this from being used normally is having the devtools extension server block access once the URL of the inspected page changes.

Unfortunately, since only the URL is checked rather than the page's origin, so there is a small window of time after a navigation occurs where the origin is set to the new page but the URL is unchanged. If chrome.devtools.inspectedWindow.reload is called during this period, then it will execute arbitrary JS on the page that is being navigated to.

This window of time can be fairly reliably hit by spamming chrome.devtools.inspectedWindow.reload calls, then using chrome.tabs.update(chrome.devtools.inspectedWindow.tabId, {url: "chrome://settings"}); to perform the navigation. Now we can run arbitrary JS on any chrome:// page, bypassing any permissions checks.

BISECT

Injecting scripts on inspectedWindow.reload was added 13 years ago, so its likely that this part of the bug works on nearly every version of Chrome.

VERSION

Chrome Version: 125.0.6422.60 stable Operating System: Debian 12

REPRODUCTION CASE

  1. Download the files attached to this report and place them in the same folder
  2. Open Chromium and load the files as an extension
  3. Open devtools on about:blank or any other unprivileged page

A video is attached which demonstrates this.

CREDIT INFORMATION

Reporter credit: Allen Ding

The original report as published on the Chromium issue tracker, by Allen Ding. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An extension with the devtools_page permission could run arbitrary JavaScript on any privileged page, including chrome:// pages, bypassing permission checks.

What the attacker needed

Extension with devtools_page permission; user opens DevTools on an unprivileged page

The fix

The bug was fixed in the original issue.

How it was found

  1. Download the attached files and place them in the same folder.
  2. Open Chromium and load the files as an extension.
  3. Open DevTools on about:blank or any other unprivileged page.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A browser extension with special DevTools permissions can normally only run code on the page being inspected. Due to a timing flaw, it can briefly run code on any page, even internal browser pages that are normally off-limits. This lets an attacker do things they shouldn't be able to do.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Allen Ding

View all

2 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.