Locally installed application can register “news” and “snews” protocols and get opened by default
Firefox opens the news and snews URL schemes without asking the user, and on macOS a downloaded application can register those schemes automatically. An attacker could get a malicious app opened, leading to code execution, especially if the app was fetched with git or curl so the quarantine flag is never set.
- Fixed in 27 days
- Paid in 34 days
- Disclosed after 27 days
Created attachment 9413323 poc.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Steps to reproduce:
Reproduce
1、git clone https://github.com/koocola/test_app.git 2、Browse poc.html in firefox. 3、open the click_me button or wait 30s then you will see calculator open
Details
-
reference to => CVE-2023-7012
-
This behaves the same as Chrome before the patch and could have a big impact on macOS.
-
I'm reporting this because there hasn't been a patch for Firefox in two years.
mailto,news,snewsare three external URL schemes in firefox that are handled by default without asking the user for permission. On Windows or Linux, this is fine and can be considered a feature. However, this can have serious security implications on macos.In macos, most user don’t have an application to handle
newsandsnewsurl scheme. And if an application was download from network. Macos system will automatically register the application’s url scheme from itsinfo.plist. Turns out if a malicious application withnewsandsnewsurl scheme mentioned in thereinfo.plist. Then chrome can usesnews://xxxornews://xxxto open it. Lead to arbitrary codeexecution.However, macos has there own security mechanism called gatekeeper to detect user open the application from network directly. If user download an application from network directly. Then the file will be set a flag
com.apple.quarantine. The first open of an application with this flag will ask user whether they really want to open this application which is from network.1、Using git or curl(eg..).
If an application is downloaded from git or curl. It will not set the flag “com.apple.quarantine”. It means the application can be opened without any warning message. So bypass the gatekeeper.
So there has a attack situation.
User visit attacker’s website. Attacker could guide user to use git to clone a malicious github or gitlab repo which include a malicious application has “news” and “snews” url scheme mentioned in there info.plist. Once git clone success. the “news” and “snews” url scheme will be registered to mac. Then the website in chrome can use “news” or “snews” url scheme to open the malicious app.
**In this attack situation. The only thing user should do is to git clone a repo. User will not realize this operation has any security impact. And then rce and sbx escape will be achieved.**
2、 With a gatekeeper bypass bug in mac.
Although user may upgrade chrome to the newest version. there operation system may not upgrade to the newest. And the version of user’s operation system information will be sent to attacker by the first get requests user requests the website. If a user’s operation system is lower then 15.1( user don’t upgrade there system after july, 2022). User can use cve-2022-32910(See https://www.jamf.com/blog/jamf-threat-labs-macos-archive-utility-vulnerability/) to bypass gatekeeper.
So there has a attack situation.
A user don’t upgrade there operation system from july,2022. A user visit attacker's website. Attacker’s website automatically download a zip file. User curiously click the zip file then macos will automatically unzip it. Then a malicious application will be released to user’s computer and “news”,snews url scheme is registered. After that , the website can open this malicious application without user's permission with the url scheme being registered.
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 Firefox treats news and snews as safe external schemes and launches their handler without a confirmation prompt, while macOS auto-registers schemes from any downloaded app bundle.
Impact
An attacker could achieve arbitrary code execution and sandbox escape on macOS, though the first route needs the user to clone a repository and the second needs an outdated macOS with a separate Gatekeeper bypass.
What the attacker needed
MacOS victim; victim clones a malicious repo; or outdated macOS with Gatekeeper bypass
The fix
Firefox should prompt the user before opening the news and snews schemes, as Chrome did after its patch.
How it was found
- Clone the test application repository.
- Open the proof-of-concept page in Firefox.
- Click the button or wait thirty seconds.
- The calculator opens, showing the scheme launched an application.
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 URL scheme is the part before the colon, like mailto: or news:. When you click such a link, the browser hands it to whichever program on your computer says it handles that scheme. On macOS, a program you download can claim a scheme just by listing it in its settings file, so a malicious program can make itself the handler and then be launched by a simple link.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.