The discovery of a critical bug in Safari that violates the Same-Origin Policy

When Anthropic presented Mythos and Project Glasswing, reactions were immediate and polarized. Some dismissed the news as mere fear-based marketing, while others considered it a credible change in the threat landscape. The truth, probably, lies in between. I decided to test this situation for myself, taking advantage of recent access to OpenAI's Trusted Access for Cyber program. I found that GPT-5.4 identified the bugs and helped assemble a working exploit chain. However, it was not just a matter of a prompt like "create an exploit for me." It required guiding it with domain-specific knowledge, iterative probing, and the ability to recognize which paths were actually exploitable.

The context of security in modern browsers

In modern versions of browsers like Safari, exploitation is less about discovering bugs and more about discovering bugs that are still relevant after numerous layers of defense. The bug I will discuss today falls into a particularly interesting category: it does not provide a path for remote code execution (RCE) or sandbox escape, but rather crosses a different boundary, violating the Same-Origin Policy. If I had visited a malicious page from any Apple device, it could have read authenticated cross-origin data from other sites you use, including access tokens and other sensitive information, making account theft trivial.

The matryoshka structure of the sandbox

Exploiting browsers in 2026 is very similar to being trapped in a Russian matryoshka doll. You start in the smallest matryoshka, and every time you exit a level, you realize you are still trapped in another. Finding a low-level memory bug is not the same as finding an exploit. Many of these bugs "die" in the gap between "memory corruption has occurred" and "something significant has crossed a security boundary."

The bug in the update logic

The original bug resides in the update logic for non-shared, resizable WebAssembly memory. When a WebAssembly.Memory grows in BoundsChecking mode, JavaScriptCore can replace the underlying memory handle. This is not the bug. The bug is what happens afterward due to memory.toResizableBuffer(). Safari updates the buffer metadata after memory.grow(), but leaves m_data pointing to the old freed allocation. As a result, after memory growth, JavaScript can hold a buffer whose reported size and handle are new, but whose actual data pointer still refers to the old freed Primitive Gigacage allocation. This results in a stale typed view onto freed memory.

Why the bug did not seem exploitable initially

The stale view is confined within JavaScriptCore's Gigacage, limiting what can be done with it. Many typical targets never land there, lack useful structure, or produce no cross-boundary effect.

The turning point

Instead of asking myself "how can I get from my stale WASM view to a protected browser state?", I started asking a better question: "What browser code takes data that JavaScript is not allowed to read, but still copies into normal renderer memory?". This narrowed the search space to subsystems that handle cross-origin sensitive data and still allocate ArrayBuffer-backed memory as part of their internal pipeline. This points directly to Fetch.

The mode violation

The surprising part is Response.clone(). If FetchResponse::clone() is called while the response is still loading, WebKit would internally create a readable stream so it can siphon the body between the original response and the clone. The normal body path blocks opaque responses, but the FetchResponse::clone() path does not initially apply the same opaque body check. Once that happens, the bytes of the hidden response start becoming very real renderer objects.

The exploit chain

At a high level, the exploit became: 1. Force the target WASM memory into the BoundsChecking path. 2. Call memory.toResizableBuffer(). 3. Grow the memory. 4. Keep the stale resizable buffer whose pointer still aims at freed Primitive Gigacage pages. 5. Trigger a cross-origin fetch(…, { mode: “no-cors”, credentials: “include” }). 6. Call response.clone() while the response is still loading. 7. Let Fetch internals materialize the hidden body bytes into ordinary renderer ArrayBuffers. 8. Reclaim the WASM-stale-covered pages with those allocations. 9. Read the cross-origin bytes through the stale view.

The file:// detour

One of the strangest parts of the research was that request-side behavior varied depending on where it was launched from. In my testing, cross-origin requests were much easier to trigger from file:// than from a normal https attack page. This seems counterintuitive until you look at how WebKit handles local origins. Document.cpp has explicit special cases around local documents and settings like allowUniversalAccessFromFileURLs and allowFileAccessFromFileURLs.

The impact on user security

This exploit represents a significant threat to the security of Apple device users and beyond. The ability to read cross-origin data, such as access tokens and sensitive information, turns a simple web-based attack into a potential identity theft. The practical demonstration sent to Apple clearly shows how data from services like Apple Connect and iCloud can be exposed, but the problem is much broader: any website could be vulnerable.

The role of GPT-5.4 in identifying the bug

Although GPT-5.4 played a crucial role in identifying the bugs and assembling the exploit chain, it is important to emphasize that the process was not automatic. Guiding the AI required domain-specific knowledge, iterative research, and the ability to distinguish which paths were actually exploitable. This demonstrates that, despite advances in artificial intelligence, human expertise remains indispensable for cybersecurity.

Implications for web developers

For web developers, this bug underscores the importance of fully understanding the implications of the Fetch API and opaque responses. Although the Fetch model is designed to protect cross-origin data, this case demonstrates that there are still vulnerabilities that can be exploited. Developers should be aware of the limitations of existing security measures and adopt programming practices that minimize risks.

Apple's responses and bug fixes

After the bug was reported, Apple launched an in-depth investigation and released security updates to fix the vulnerability. However, this case highlights the need for greater vigilance and a proactive approach to security from technology companies. Users are advised to keep their devices updated to protect themselves from potential attacks.

Lessons learned for cybersecurity

This exploit offers important lessons for the field of cybersecurity. First, it demonstrates that even seemingly contained bugs can have significant consequences when combined with other system elements. Additionally, it underscores the importance of creative thinking and a different perspective in solving complex problems. Finally, it highlights the need for ongoing collaboration between researchers, developers, and companies to address cybersecurity challenges.

The future of browser security

With the continuous evolution of browsers and web technologies, it is likely that new vulnerabilities will emerge. However, cases like this can serve as a catalyst for improving security architectures and developing more robust solutions. The cybersecurity community must remain vigilant and ready to respond to new threats that may arise.

Conclusions

The analysis of this exploit reveals the complexity of modern browser security and the need for a multidisciplinary approach to address threats. Collaboration between artificial intelligence, security experts, and developers is essential to ensure a safer web environment for all users.

Editorial Note and Disclaimer

The guides and content published on GoYou are the result of independent research and analysis activities, for informational, educational, and in-depth purposes.

GoYou does not constitute a journalistic publication or an editorial product pursuant to Law No. 62/2001 and does not provide real-time information.

The GoYou project does not provide professional, technical, legal, or financial advice and disclaims all liability for the misuse of the information published.

In the Crypto sector, every investment involves risks: readers are invited to always inform themselves independently before making any decision.