Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

The Last Proof of Human Craft: Forging a Microsoft Edge Full Chain with Logic Bugs Only! - 2245

Orange TsaiPosted 11 Days Ago
  • For Pwn2Own Berlin, they decided to search for bugs in Microsoft Edge. Through manual effort only (no AI) and only logic bugs (no memory corruption), they popped it. Chrome Navigation has a feature called Navigation Throttles. It lives in the Browser Process and intercepts all navigation requests initiated by the Browser or the Renderer. Of the 3K CVEs on Chrome, only 20 have been related to this area of code. So they found it an interesting attack surface.
  • Orange found that Edge has a throttle called EdgeCAGuidanceNavigationThrottle for its enterprise Entra ID feature. This throttle guides users to the right User Profile when Edge detects a work account sign-in on a Microsoft-owned website, redirecting them to the Microsoft-owned domain. If they don't match, Edge creates a dialog to switch accounts. If they do match, Edge grabs the URL you originally meant to switch to and creates a new navigation through Chrome's internal navigation API.
  • Since the new navigation occurs from the Browser Process, it has special privileges like accessing devtools or using the JavaScript URI. At first glance, this wasn't very useful because you needed a mechanism to trigger this from login.live.com in the first place. So, it'd be more of a self-XSS. After this sat on the shelf for a few weeks, they had an idea...
  • They were reviewing the architecture of Chrome when they had a thought... The throttle happens in the Browser process, alongside the navigation. But, the page that the bug is fired from lives in the Renderer. So, what does CURRENT_TAB exist in? They ran setTimeout() to change the URL to https://guidance-ca-error/?email={email}&switch_profile={url} after the throttle. To their surprise, the URL with the JavaScript URI executed on the exact page they wanted! It was universal XSS in the browser. The root cause was that the Renderer used the current active tab as the Renderer Source, even if it wasn't the domain that originated the request. Neat!
  • This bug was great, but it had major limitations to work around. First, the exploit could only happen from login.live.com. The check for this was brittle since it used web_contents->GetLastCommittedURL(). This isn't the origin or the domain; it's the last navigated-to domain. By running window.open() to the page, and then moving the location of the popup to the desired attacker-controlled URL, the check is bypassed. This attempts to check the page origin, but it uses the wrong field.
  • The exploit assumes that a user has a signed-in User Profile and that the email supplied matches their email. By first naviagating to www.microsoft.com, a User Profile is automatically made for you! Even with this sign-in, you need to know the email. To find the logged-in email, they found an MSN endpoint that had messed up CORS headers and returned the logged-in email. So, you could make a request to the MSN endpoint (with credentials included because of how cookies work) to get the email.
  • The next issue was around popups. Most browsers don't let you open arbitrary pop-up windows. By opening a popup to a whitelisted window, like about:blank#quickAuthPopup, and then swapping it to a different location, the popup would just appear. A super simple bypass for the popup issue. Together, this leads to a single-website-visit universal XSS. This means running arbitrary JavaScript on any page, like Google or Facebook. They still wanted to execute code on the victim's computer, which would require more bugs.
  • Their first idea was if they could run JavaScript on privileged pages, such as edge://settings. Alas, the Chromium developers have a check to ensure that all privileged pages won't execute JavaScript from the javascript:// URI. While reviewing Microsoft Edge, they found that the Immersive Reader functionality used a very old fork of Chromium. So old that it's blacklist was missing the custom read:// schema! So, this gave them access to many natives pieces of functionality. From there, they found an arbitrary file-write primitive through log-file diagnostic writing.
  • With the arbitrary file write, they decided to override the protocols.json file that controls which origins are allowed to run specific URL protocol handlers. This let them run any protocol handler from the browser, including other handlers they wrote! So, the full chain led to RCE on the victim's laptop from clicking a single link. The whole experience, from having no experience with browsers to completing the full chain, took them two months without using AI.
  • Why didn't they use AI? They didn't start using a coding agent until after a lot of this work was already done. The author of this post was really good at finding the primitive they needed in obscure functionality. I imagine this is hard for AI to do, but we'll see. Overall, an amazing post with a great set of bugs!
  • They end with some thoughts on AI. They say they are not afraid of being replaced by AI. In fact, they have enough time to finish all of the cool ideas they've had sitting on their TODO list. This just changes the scale at which we can do stuff. They end with a good quote: "So instead of worrying about how low the bar for vuln research can go, why not get excited about how high AI can take us?" I think that this will be the only way to be happy with bug hunting in the future.