The isolation of websites is paramount. Notably, one website cannot read the contents, or modify an existing page. Since one web page can be iFramed inside another, this is particularly important. This report breaks that guarentee.
If a user interacts with an image in the context menu (think the "send link to X" menu), the browser attempts to retrieve the image data. This is done using a combination of native code in Safari, and injected JavaScript to the page.
The native code targets the main frame of the page without any consideration of where the image was clicked on. Since the image is in the wrong frame, it falls back to performing an XMLHttpRequest for the image URL. The main page is controlled by the attacker, which gives them flexibility to do a lot of things.
To exploit this, an attacker would do the following:
- Host a malicious website that registers a service worker that listens for
fetch events. Additionally, embed the cross-origin page that contains the sensitive image.
- Use clickjacking to trick the user into long-pressing the sensitive image, and then selecting one of the image options in the menu.
- The fallback HTTP request is triggered since the image isn't on the page.
- The listening service worker sees the HTTP request, and intercepts it. They can see all of the information on the URL, including potential secret information.
This report is super off to me... it was found by an AI agent but not tested, according to the report. It's very strange that this was submitted WITHOUT verifying that the PoC actually works. Overall, a very neat and impactful issue though.