Skip to content
XSS Write-up Advanced

Two XSS Vulnerabilities in Azure with Embedded postMessage IFrames

Two Azure services, Azure Bastion and Azure Container Registry, embedded attacker-controlled endpoints in iframes and accepted postMessages without properly validating their origin or sanitising SVG content, allowing an attacker to run script in the victim's session. This could give unauthorised access to the victim's session within the affected Azure service.

Lidor Ben Shitrit Follow

Published on orca.security

Microsoft Azure offers a diverse range of services that empower organizations with convenient and scalable cloud infrastructure solutions. However, even robust systems can fall victim to security vulnerabilities that require prompt identification and mitigation.

Lidor Ben Shitrit, on orca.security

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the postMessage handlers did not properly validate the message origin and did not sanitise SVG content before rendering it, so attacker-supplied data reached a script execution sink.

Impact

An attacker could gain unauthorised access to the victim's session within the compromised Azure service, potentially leading to data access, modification or disruption, though the sandbox's missing allow-modals attribute blocked simple alert pop-ups.

What the attacker needed

Victim clicks an attacker link; attacker-controlled endpoint; Azure Bastion service in use

The fix

Microsoft fixed both vulnerabilities in the Azure infrastructure after reproducing them.

How it was found

  1. Set up an Azure Bastion service and open the Connect option.
  2. Connect without opening a new tab so the Bastion host page is embedded in an iframe.
  3. Replace the endpoint in the connection URL with an attacker-controlled server and confirm it is embedded.
  4. Run a Connection Troubleshoot test and switch to the Topology View.
  5. Modify the postMessage that renders the topology graph so it contains a malicious script.
  6. Send the modified postMessage and observe that the script executes.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A web page can include another page inside a frame, and those pages can send each other messages. If the receiving page trusts messages from anywhere and puts their content on screen without cleaning it, an attacker can make the victim's browser run the attacker's code. That code then acts as the victim inside the Azure service.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Lidor Ben Shitrit

View all

6 more disclosed reports, best first.

More from Microsoft (Azure)

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.