ChromeOnly event interfaces become exposed to web content when chromeEventHandler listener callbacks run
ChromeOnly event interfaces such as NotifyPaintEvent and StyleSheetApplicableStateChangeEvent were exposed to ordinary web content whenever chromeEventHandler listener callbacks ran. An attacker could therefore detect whether DevTools were open by checking for the existence of these interfaces.
Originally disclosed on Mozilla
- Fixed in 31 days
- Paid in 43 days
- Disclosed after 31 days
Created attachment 9411638
detect_devtools_opened.html
Steps to reproduce:
1) Navigate to https://www.google.com/
2) Open DevTools console
3) Run `typeof NotifyPaintEvent`
Actual results:
type is `function`
Expected results:
type is `undefined`
This is surprising given that this interface has been ChromeOnly since bug 1334957
In a local build, commenting out this `MozAfterPaint` listener in AboutReaderChild results in `NotifyPaintEvent` not being present in web content
https://searchfox.org/mozilla-central/rev/6936c4c3fc9bee166912fce10104fbe0417d77d3/browser/actors/AboutReaderChild.sys.mjs#199-202
Another example is [`StyleSheetApplicableStateChangeEvent`](https://searchfox.org/mozilla-central/rev/6936c4c3fc9bee166912fce10104fbe0417d77d3/dom/chrome-webidl/StyleSheetApplicableStateChangeEvent.webidl). This one is fun because `StyleSheetApplicableStateChanged` events only fire when DevTools are open
https://searchfox.org/mozilla-central/rev/a5bcdc6afbcfccf9f293ace0fddf11307e5bc22c/devtools/server/actors/utils/stylesheets-manager.js#252-256
So, it's possible to construct a test case that detects when DevTools are opened by looking for the existence of this interface.
Steps to reproduce:
1) Navigate to the attached test case
2) Open DevTools
Actual results:
Test case says devtools opened
Expected results:
Test case doesn't say that
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
A website could detect when DevTools are opened, which may reveal user behaviour, though the text shows no further exploitation.
What the attacker needed
Victim opens a malicious page; victim opens DevTools
How it was found
- Open a page in the browser and open the DevTools console.
- Check the type of the NotifyPaintEvent interface and observe it is a function rather than undefined.
- Load the attached test case and open DevTools to see it report that DevTools were opened.
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.
Some browser features are meant to be visible only to the browser's own internal code, not to websites. Here, internal event objects leaked into the page's world, so a website could notice them and tell whether the user had opened the developer tools. That is a small privacy leak rather than a way to take over the browser.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.