Detect Content Script of Cross-Origin using worker load-error messages
Firefox produced different worker load-error messages depending on whether a cross-origin URL served JavaScript, letting a site detect the content type of cross-origin resources. An attacker could use this to probe whether a cross-origin URL is a JavaScript file.
Originally disclosed on Mozilla
- Fixed in 23 days
- Paid in 28 days
- Disclosed after 23 days
Created attachment 9391942
poc.html
On Firefox browser, a site could still detect content across cross-origin whether it is application/javascript using error messages. This is because of different variations of error messages. For example, if application/javascript is detected, Firefox produces the error: `NetworkError: WorkerGlobalScope.importScripts: Failed to load worker script at https://www.google-analytics.com/ (nsresult = 0x80530013).` If not, it produces the error: `NetworkError: A network error occurred.`
Steps to Reproduce:
1. Download the file `poc.html`.
2. Open `poc.html` in a Firefox browser, then copy and paste `https://www.google-analytics.com/analytics.js` into the input field and click "check" to see if it is detected. Repeat with just `https://www.google-analytics.com` to see not detected.
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
Root cause
Likely the browser exposed different worker load-error messages for cross-origin scripts based on whether the response was JavaScript, creating a content-type oracle.
What the attacker needed
Victim uses Firefox; victim visits attacker page
How it was found
- Download the proof-of-concept HTML file.
- Open it in Firefox, enter a cross-origin JavaScript URL, and click check to see it detected.
- Repeat with the same host without the JavaScript path to see it not detected.
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.
Websites are normally not allowed to read content from other websites. This report shows that Firefox's error messages for failed background scripts (workers) differed depending on whether the other site's file was JavaScript, so a site could learn that fact. It is a small information leak, not a way to read the file itself.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.