Skip to content
XSS Write-up Intermediate

Microsoft Azure Portal – Persistent Cross-Site Scripting

The Azure Portal notification widget did not encode certain HTML characters, allowing a low-privileged user to inject a malicious group name that rendered as HTML and executed JavaScript when clicked by another user. This could let an attacker read and modify the logged-in user's content and potentially escalate privileges to Portal Administrator.

Christian Becker Follow

Published on y-security.de

The notification widget of the Microsoft Azure Portal does not encode certain HTML characters. This allows to inject HTML and JavaScript code into the Azure Portal, which is reflected for other users (of the same Azure Active Directory Tenant).

sven, on y-security.de

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 URL scheme filter used a regular expression that allowed 'mailto:' anywhere in the string instead of only at the start, and the notification widget did not HTML-encode the group name.

Impact

The persistent XSS could allow an attacker to read and modify the content of the logged-in user and potentially escalate privileges to Portal Administrator.

What the attacker needed

Low-privileged Azure AD user; victim clicks the notification text; victim is in same Azure AD tenant

The fix

The mailto: filter was changed to require it at the start of the string, and HTML encoding is recommended to mitigate HTML injection.

How it was found

  1. As a low-privileged user, open the Azure Portal and go to Azure Active Directory > Groups.
  2. Create a new group with a name containing an HTML anchor element with a javascript: URL.
  3. As an administrator, open the Azure Portal and go to Azure Active Directory > Users, then click any user.
  4. Under Manage > Groups, click Add memberships and add the previously created group.
  5. The portal shows a notification that renders the HTML, and clicking the text executes the JavaScript.

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 normally treats user input as text, not code. Here, a group name containing HTML was shown in a notification without being made safe, so the browser ran the embedded JavaScript when a user clicked it. This is called cross-site scripting (XSS): an attacker sneaks code into a trusted site to act as the victim.

What is XSS?

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

More from Microsoft

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.