My First Azure Bug: From a Single XSRF to Multiple Vulnerabilities

Matthew Jensen (Independent Security Researcher), Sonal Shrivastava (Security Researcher, MSRC Vulnerabilities and Mitigations · Microsoft)

BlueHat Asia 2026 · Day 1 · Main Stage

Overview

This compelling talk, "My First Azure Bug: From a Single XSRF to Multiple Vulnerabilities," presented by independent security researcher Matthew Jensen and Microsoft's Sonal Shrivastava at BlueHat Asia, delves into the evolution of Cross-Site Request Forgery (CSRF) from a browser-centric vulnerability to a critical control plane threat in cloud environments like Azure. The speakers challenge the conventional wisdom that CSRF is a "solved class" of vulnerability, demonstrating how its underlying principles persist and even amplify in modern cloud architectures.

Watch on YouTube

Visual summary for My First Azure Bug: From a Single XSRF to Multiple Vulnerabilities by Matthew Jensen, Sonal Shrivastava
Visual summary for My First Azure Bug: From a Single XSRF to Multiple Vulnerabilities by Matthew Jensen, Sonal Shrivastava

Key moments

  1. 0:30 CSRF evolving from browser HTML to cloud control plane
  2. 2:00 Researcher's iterative approach led to root cause fixes
  3. 5:00 Uncovering ARM API control through UI definitions
  4. 8:00 Clever data exfiltration using KQL queries
  5. 11:00 Bypassing HTTP method restrictions with batch-in-batch path traversal
  6. 14:30 Demonstrating full tenant compromise via UI definitions
  7. 17:30 Microsoft's defense-in-depth fixes, including user consent
  8. 20:00 Vulnerability classes evolve: misplaced trust boundaries

My First Azure Bug: From a Single XSRF to Multiple Vulnerabilities

Speakers: Matthew Jensen (Independent Security Researcher); Sonal Shrivastava (Microsoft)

Conference: BlueHat Asia

YouTube: https://www.youtube.com/watch?v=Kzy7hvClv-I

Overview

This compelling talk, "My First Azure Bug: From a Single XSRF to Multiple Vulnerabilities," presented by independent security researcher Matthew Jensen and Microsoft's Sonal Shrivastava at BlueHat Asia, delves into the evolution of Cross-Site Request Forgery (CSRF) from a browser-centric vulnerability to a critical control plane threat in cloud environments like Azure. The speakers challenge the conventional wisdom that CSRF is a "solved class" of vulnerability, demonstrating how its underlying principles persist and even amplify in modern cloud architectures.

The presentation highlights a remarkable collaboration between Matthew Jensen, who initially discovered an Azure vulnerability, and Microsoft's MSRC team. This partnership transcended a typical bug bounty report, evolving into a sustained effort to identify and eradicate a class of vulnerabilities at its root cause across multiple Azure services. Jensen's persistent, "first principles" approach to mapping the vulnerability across different attack surfaces was instrumental in Microsoft's ability to implement comprehensive fixes and even drive internal process improvements.

The talk serves as a crucial case study, illustrating how a seemingly simple CSRF-like flaw can escalate into multiple critical vulnerabilities, potentially leading to a full tenant compromise in Azure. It provides a detailed technical deep dive into the specific mechanisms exploited, including undocumented API controls, path traversal bypasses, and data exfiltration techniques. Ultimately, it underscores the importance of continuously re-evaluating trust boundaries in increasingly complex cloud platforms and offers vital defensive strategies for both cloud providers and consumers.

Background

▶ Watch: CSRF evolving from browser HTML to cloud control plane (0:30)

For over two decades, Cross-Site Request Forgery (CSRF) has been a recognized web vulnerability. In the early 2000s, CSRF attacks typically involved malicious, auto-submitting HTML forms that tricked a user's browser into performing unwanted actions on a legitimate website where they were authenticated, such as changing an email address or transferring funds. The industry responded effectively to this threat model with mitigation techniques like CSRF tokens and, more recently, Same-Site cookies becoming a browser default. By 2020, many security professionals considered CSRF to be a largely solved problem, believing these defenses had rendered it obsolete.

However, this research fundamentally challenges that assumption. Sonal Shrivastava explains that traditional CSRF defenses were predicated on a specific threat model: an attacker's cross-site HTML form riding the user's authenticated cookie. In modern cloud environments, particularly within Azure, the landscape has dramatically shifted. The entity making authenticated calls is no longer an attacker's external form but rather the Azure first-party portal itself – the control plane – performing its intended functions. In this scenario, Same-Site cookie policies simply do not apply, as the requests are originating from within the trusted domain.

Consequently, CSRF did not disappear; it evolved and moved up the stack. Its manifestation shifted from browser HTML to the cloud control plane, and with this shift, the potential impact escalated dramatically. What once might have led to a minor account change now poses a risk of complete tenant compromise. Matthew Jensen's journey into discovering these vulnerabilities began with a seemingly innocuous goal: improving the user interface for deploying Azure resources using ARM templates. His curiosity about how visually appealing UIs were created for services like Microsoft Sentinel led him to uncover a previously undocumented mechanism, the create UI definition URI parameter and associated UI definition JSON, which ultimately became the entry point for a series of critical findings.

Key Findings

▶ Watch: Uncovering ARM API control through UI definitions (5:00)

Matthew Jensen's research, initiated by his quest for a better ARM template user interface, uncovered a series of critical vulnerabilities stemming from an evolved form of CSRF in the Azure control plane. His key findings can be categorized into three main areas: the exploitation of undocumented API controls, a sophisticated bypass of HTTP method restrictions, and the discovery of widespread applicability across Azure services.

The initial discovery centered on the arm API control element within Azure's UI definitions. These definitions, typically JSON pages used to create richer user interfaces for ARM template deployments, contained an element designed to run requests to Azure on a user's behalf. While initially restricted to GET and POST HTTP methods, this alone presented a significant risk. Jensen realized that certain Azure services, such as storage accounts, allowed retrieving sensitive data like storage account keys via POST requests. This opened the door to data exfiltration.

To achieve practical exfiltration, Jensen devised a multi-step attack chain:

  1. List available Azure Log Analytics workspaces.
  2. Enumerate storage accounts.
  3. Retrieve storage account keys using a POST request via the arm API control.
  4. Crucially, exfiltrate these keys by embedding them into a KQL query that utilizes the externaldata operator to send the sensitive information to an attacker-controlled endpoint via a Log Analytics workspace. This leveraged the legitimate functionality of KQL to make outbound calls.

The second major finding involved bypassing the HTTP method restriction (GET/POST only) to enable more powerful actions like resource creation or role assignments, which typically require PUT requests. Jensen observed that all requests through the arm API control were routed through a /batch endpoint, which itself accepted POST requests. He theorized that if he could send a batch request within another batch request, he might be able to control the inner request's method. After extensive experimentation, including path traversal attempts, he successfully achieved this using double URL encoding. By encoding a path like %252fsubscriptions%252f..%252fbatch, the Azure management API would first decode it, then normalize it to /subscriptions/../batch, effectively bypassing the direct batch endpoint restriction. This allowed an attacker to encapsulate a PUT request, such as one for a role assignment, within the POST body of the outer batch request, thereby elevating privileges.

Further investigation, initiated by searching for "ARM API control" in browser developer tools, revealed a similar, equally potent component: graph API control. This element allowed authenticated calls to the Microsoft Graph API, also restricted to GET/POST. However, Graph API's POST requests are inherently powerful, capable of creating many resources, including new applications with associated secrets. This meant that even without the batch bypass, significant malicious actions could be performed.

Finally, Jensen discovered that these UI definitions were not confined to just ARM template URLs but were also employed in Azure Managed Applications and Azure Template Specs. This widespread adoption meant that the attack surface was significantly larger than initially perceived. The culmination of these findings demonstrated that by simply providing a user with a crafted URL containing a malicious UI definition, an attacker could trigger a chain of events – including creating applications, extracting secrets, and assigning roles – ultimately leading to a full tenant compromise without any explicit user awareness or action.

Technical Deep Dive

▶ Watch: Bypassing HTTP method restrictions with batch-in-batch path traversal (11:00)

Matthew Jensen's journey began with an investigation into the visually appealing user interfaces for deploying Azure resources, particularly those used by Microsoft Sentinel. He noted that standard ARM template deployments often present a "dull and boring" interface with basic input fields. His curiosity led him to discover the create UI definition URI parameter in deployment URLs, which pointed to a UI definition – a JSON-based page designed to enhance the user experience for ARM template deployments.

These UI definitions are powerful, allowing for the creation of rich interfaces with elements such as custom text boxes, key box selectors, and managed identity selectors. Crucially, one specific element stood out: the arm API control. This control was designed to run requests to Azure's management API on behalf of the user, typically to populate fields with dynamic data (e.g., listing all Log Analytics workspaces in a specific region). Initially, Jensen observed that this control was limited to GET and POST HTTP requests. While this seemed restrictive, it was a critical starting point. Creating or updating resources and assigning roles in Azure typically requires PUT requests, suggesting an initial limitation on the arm API control's destructive potential.

However, Jensen identified that certain Azure services do allow the retrieval of sensitive data via POST requests. Specifically, he targeted storage account keys, which could be fetched using a POST request. The challenge then became how to exfiltrate this retrieved data to an attacker-controlled endpoint, as the arm API control itself was restricted to calling the Azure management API. His ingenious solution leveraged Azure Log Analytics workspaces and KQL (Kusto Query Language). He found that a KQL query could be crafted to call an externaldata operator, which allows sending data to an external URL. The attack chain for exfiltration was as follows:

  1. Use arm API control to list all Log Analytics workspaces accessible to the victim.
  2. Use arm API control to list storage accounts.
  3. Use arm API control with a POST request to retrieve the storage account keys.
  4. Finally, construct and execute a KQL query via arm API control that included the retrieved storage account key, sending it to an attacker's controlled domain. This effectively turned a legitimate logging mechanism into a data exfiltration channel.

A deeper dive into how arm API control requests were processed revealed that they were always routed through a /batch endpoint in the browser. This endpoint was responsible for batching multiple API calls into a single HTTP request. The HTTP method restriction (GET/POST) was enforced at this batching layer. Jensen's pivotal insight was realizing that the /batch endpoint itself was a POST request. This led to the hypothesis: could he send a batch request inside another batch request, effectively allowing him to control the inner request's HTTP method?

Directly calling the /batch API from within the arm API control was blocked. To bypass this, Jensen employed a path traversal technique combined with double URL encoding. The malicious payload for the arm API control's path would be set to something like %252fsubscriptions%252f..%252fbatch. When this request reached the Azure management API, the double encoding (%25) would first decode to a single encoding (%2f), resulting in /subscriptions/../batch. The Azure system would then normalize this path, effectively resolving it to the batch endpoint without triggering the initial direct /batch restriction. This clever maneuver allowed an attacker to send a POST request to the batch endpoint, with the POST body containing a second request – this time, a PUT request – for actions like assigning a new role (e.g., Contributor) to an attacker-controlled service principal within the victim's subscription. This effectively elevated privileges and demonstrated a critical bypass of the method restrictions.

Matthew's methodology for finding more vulnerabilities was equally insightful. Instead of relying solely on documentation, he opened his browser's developer tools (F12) and searched for "ARM API control" within the loaded scripts and network traffic. This led him to discover a previously undocumented component: graph API control. As its name suggests, this control offered similar functionality to arm API control but specifically for the Microsoft Graph API. While it also had GET/POST restrictions, Graph API's POST requests are inherently powerful. For instance, creating a new application registration with an associated secret requires only a POST request. This meant that an attacker could use graph API control to create a malicious application, obtain its secret, and then use that application to further compromise the tenant. The talk mentioned that this control operated under permissions like application.readwrite.all and group member.read.all, highlighting its broad capabilities.

The final piece of the puzzle was understanding the full scope of these UI definitions. Jensen discovered they were not just used in simple ARM template deployment URLs but were also integral to Azure Managed Applications and Azure Template Specs. This meant that the attack surface was considerably wider, as these UI definitions could be embedded in various legitimate Azure workflows. The cumulative impact of these findings demonstrated a clear path to full tenant compromise: an attacker could craft a malicious UI definition, host it, and then lure a victim into clicking a seemingly benign URL. This single action could trigger a cascade of authenticated API calls, including creating malicious applications, exfiltrating sensitive keys, and assigning elevated roles, all without the user's knowledge or explicit consent.

Demo / Proof of Concept

▶ Watch: Demonstrating full tenant compromise via UI definitions (14:30)

While the talk did not feature a live, interactive demonstration of the exploits, Matthew Jensen meticulously detailed the technical steps and crafted payloads that constitute a robust proof of concept (PoC) for each vulnerability class. He presented the specific URL structures, JSON payloads for the UI definitions, and the double URL encoded path traversal strings that would successfully trigger the vulnerabilities.

The PoC for data exfiltration would involve:

  1. A crafted UI definition JSON hosted by the attacker, containing an arm API control element.
  2. This element would first execute POST requests to enumerate available Log Analytics workspaces and storage accounts.
  3. Subsequently, it would perform another POST request to retrieve storage account keys.
  4. Finally, it would construct a KQL query using the externaldata operator, embedding the stolen storage account key, and sending it to an attacker-controlled endpoint.

For the privilege escalation PoC, leveraging the batch-in-batch technique:

  1. The attacker would craft a UI definition with an arm API control element.
  2. The path parameter within this control would be set to the double URL encoded string, such as %252fsubscriptions%252f..%252fbatch.
  3. The content field of the arm API control would contain a JSON payload representing a PUT request (e.g., a role assignment to grant an attacker-controlled identity 'Contributor' access).
  4. When a victim accesses the URL pointing to this malicious UI definition, the arm API control would execute the POST request to the batch endpoint, which then internally processes the embedded PUT request, leading to a role assignment.

The PoC for the graph API control would involve a UI definition using this element to perform a POST request to the Microsoft Graph API, for example, to create a new application registration and extract its secret, demonstrating immediate control over Azure Active Directory resources. Matthew's presentation of these specific payload structures and execution flows served as a comprehensive, step-by-step technical demonstration of how these vulnerabilities could be chained for a full tenant compromise.

Defensive Implications

▶ Watch: Vulnerability classes evolve: misplaced trust boundaries (20:00)

The defensive implications stemming from Matthew Jensen's discoveries and Microsoft's response are multifaceted, extending from immediate technical mitigations to broader strategic shifts in cloud security posture. Sonal Shrivastava emphasized that security fixes in a platform as vast and interconnected as Azure are rarely simple; a "secure answer" on paper can easily break legitimate, business-critical workflows for countless customers and partners.

Microsoft's initial response was swift, deploying a fix within weeks. However, the first mitigation – a blanket disabling of POST requests – indeed caused disruptions for third-party integrations. This highlighted the necessity for a more nuanced approach, which Microsoft achieved by leveraging telemetry, customer feedback, and partner insights to refine their mitigations, ensuring they addressed the root cause without unduly impacting functionality at scale.

The specific fixes implemented by Microsoft include:

  • ARM API Control: Instead of a blanket block, an allow list of HTTP verbs was implemented. This ensures that only explicitly safe operations (primarily GET requests for data retrieval) are permitted, denying any state-changing verbs by default.
  • Graph API Control: Recognizing that this component was not intended for public exposure via the deployment entry point, it was disabled altogether on the deployment stack, effectively removing a significant attack vector.
  • Batch Path Normalization: To prevent the sophisticated double URL encoding bypasses, the batch endpoint now performs robust input normalization or canonicalization. This means that encoded URLs are fully decoded and resolved before reaching the authorization check, making path traversal attempts ineffective.
  • User Consent: A crucial defense-in-depth measure, explicit user consent is now required for ARM API or Graph API calls originating from third-party integrations. This addresses the core problem of silent, unauthorized actions, forcing users to explicitly authorize potentially impactful operations. As Sonal noted, this simple yet powerful change takes away the "silence" that enabled the attacks.
  • Terminal Authorization Check: Continuous Role-Based Access Control (RBAC) enforcement is now in place, ensuring per-request authorization checks are rigorously applied, even within complex chained operations.

Beyond Microsoft's specific mitigations, Matthew Jensen offered essential advice for defenders:

  • Assume Insecurity in Trusted Platforms: Even platforms as robust as Azure, GCP, or AWS can have weaknesses. Defenders must adopt a mindset that assumes potential vulnerabilities, even when links appear legitimate.
  • Skepticism Towards Untrusted Links: Users should be inherently skeptical of any untrusted links, especially those promising "nice-looking" ARM templates or other deployments, and always inspect the URL carefully.
  • Leverage Privileged Identity Management (PIM): PIM significantly reduces the attack window for time-sensitive exploits. If an attacker targets a user with PIM activated, they would first need to trick the user into elevating their privileges, which is a process that takes time and introduces friction, often disrupting the immediate execution required for these attacks.
  • Apply Least Privilege: The principle of least privilege remains paramount. Users and service principals should only have the minimum permissions necessary to perform their functions, limiting the blast radius of any successful compromise.
  • Caution with Unexpected Prompts: Users should be wary of any unexpected prompts or requests for authentication, as these can be indicators of social engineering or phishing attempts designed to facilitate attacks.

The overarching takeaway from the talk is that vulnerability classes, especially those rooted in fundamental trust boundary issues, do not disappear; they evolve. As cloud platforms become more connected and autonomous, the challenge for defenders is not merely to remember old mitigations but to recognize when old trust assumptions resurface in new, unexpected forms. Continuous study of security fundamentals and a proactive, collaborative approach between researchers and vendors are essential to staying ahead of evolving threats.

Key Takeaways

  • CSRF's Evolution: Cross-Site Request Forgery has evolved from a browser-centric vulnerability to a critical control plane threat in cloud environments like Azure, bypassing traditional HTML-form-based defenses and leading to potential tenant compromise.
  • Malicious UI Definitions: Azure's UI definitions, when crafted maliciously, can execute arbitrary authenticated API calls (Azure Management API and Microsoft Graph API) on a user's behalf without explicit consent, creating a potent attack vector.
  • Batch Endpoint Bypass: Sophisticated path traversal using double URL encoding (%252fsubscriptions%252f..%252fbatch) on Azure's batch endpoint allowed attackers to bypass HTTP method restrictions, enabling the execution of powerful PUT requests (e.g., role assignments) within a POST request.
  • Data Exfiltration: Sensitive data, such as storage account keys, could be exfiltrated by chaining API calls and leveraging legitimate Azure services like Log Analytics workspaces to send the data via KQL queries to attacker-controlled endpoints.
  • Comprehensive Mitigation: Effective defense against such evolving threats requires a multi-layered approach, including strict HTTP method allow-listing, robust input normalization, explicit user consent for third-party API calls, and continuous RBAC enforcement.
  • Proactive Defense Strategy: Defenders must adopt a mindset that assumes insecurity even in trusted cloud platforms, enforce principles like PIM and least privilege, and remain vigilant against untrusted links and unexpected prompts to counter evolving vulnerability classes.

About the Speaker(s)

Matthew Jensen is an independent security researcher and a specialist security platform engineer. With approximately two years of experience in security research, Matthew brings a unique perspective, having transitioned from a blue teaming background (working primarily at Managed Service Providers) rather than a traditional red teaming path. His journey into bug bounty work and vulnerability research was largely accidental, driven by curiosity, as detailed in this presentation.

Sonal Shrivastava is a security researcher with the Microsoft Security Response Center (MSRC) Vulnerabilities and Mitigations team. Her role involves working closely with researchers like Matthew and internal engineering teams to validate, understand, and implement fixes for security vulnerabilities. Sonal's insights highlight the complexities of securing a vast platform like Azure and the importance of collaboration between researchers and product teams.

Reviews

Dr. Zero (Offensive Security Researcher) — SOLID

Solid bug bounty war story with a genuinely clever batch-in-batch bypass via double URL encoding. Jensen's methodology—F12, grep for control names, chain primitives—is the real takeaway. Not a new vulnerability class, but a good illustration of how old trust assumptions rot in cloud control planes.

Heather Calloway (CISO) — STRONG ACCEPT

This is a well-executed technical talk that demonstrates how CSRF-class vulnerabilities migrate into cloud control planes. The research is solid, the attack chain is credible, and every CISO running Azure workloads needs to understand that 'trusted platform' doesn't mean 'secure platform.' Worth your security leadership's attention.

→ Top-rated talks at BlueHat Asia 2026

All talks from BlueHat Asia 2026