Sending out phishing e-mails from @microsoft.com
A video title field accepted HTML, which was rendered unencoded in notification emails sent from a Microsoft domain. An attacker could inject HTML into these emails, potentially for phishing.
{{media:0}}
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.
Context
Microsoft Stream is a Microsoft service for uploading and sharing video, reachable at stream.microsoft.com. The researcher had never used it before and picked it as a target for the Microsoft bug-bounty program. The application is built on REST-style APIs, with regional backends (EU, Asia, US), XMLHttp-based requests, token-secured endpoints and several authentication headers. The backend validated every character of a request, which is why the researcher initially assumed the application could not be insecure.
The feature at the centre of the report is the core one: file upload, together with the video title and the "Share your video" functionality. When a video is processed, the service sends notification e-mails from [redacted].
Setup
The researcher used an old Microsoft account, a toolset of custom Python scripts, Burpsuite and a local web server used for documentation. The Python fuzzer used here was not yet public at the time of writing; the author says it would probably be released at github.com/si9int. No specific versions are given.
The methodology described is the same on every target:
- Reconnaissance (too large to detail in the report).
- Determine the correct application logic.
- Try to bypass the application logic in any way, not only security-related.
- Take note of "bugs", meaning application errors.
- Try to expand these functional errors into security issues.
- Try to exploit these security issues.
- Try to prove some impact (low, medium, high).
- Try to expand the impact by chaining different issues or bugs.
Finding it
Because Stream exposed "thousands" of parameters and different APIs, the researcher focused on the file upload. After understanding the logic behind the different parameters, the Python fuzzer was used to fuzz them, looking at correlations or differences between valid and invalid input based on the HTTP response and the request time.
Two observations came out of hammering the backend with different strings and payloads:
- HTML is accepted by the API but rendered back encoded. For example,
<h1>Hello world!</h1>is a valid string for a video title. - Unicode is interpreted by the API, which allows injecting different spaces and whiteblocks while disregarding the character limit (1 Unicode character counts as 1 character).
At that point there was no reflection, no anomaly and no error, only correct error handling and JavaScript functionality, so the researcher went to bed without a result.
The next morning the inbox contained many new mails from [redacted] saying that an uploaded video had been rendered successfully. In those mails the title <h1>Hello world!</h1> was executed and the HTML was rendered inside the e-mail. The title was rendered back encoded in the web application, but the HTML was rendered inside the e-mail.
Exploitation
Step 1: confirm the sink in the notification e-mail
The title <h1>Hello world!</h1> was accepted as a video title and, when the upload notification arrived from [redacted], the HTML was rendered in the message body. The researcher revisited the edit-video page and re-checked the "Share your video" functionality, then crafted a proof of concept and submitted it to the Microsoft Security Response Center.

The screenshot shows the proof of concept as submitted, described by the author as quick and dirty.
Step 2: first report and MSRC response
The first PoC abused a @microsoft.com domain for phishing purposes. MSRC moved the report to N/A. Their argument was that the mail was named after the payload, so the phishing attempt was easy to spot. The quoted closure message is:
Gaurav:
"MSRC is no longer tracking this due to its severity and impact. We have closed this case."
Step 3: use the character limit to hide the payload
Remembering the character limit and the Unicode behaviour, the researcher crafted a second PoC. The payload is a title string that starts with a plausible sentence, then uses Unicode spaces and whiteblocks to push the HTML far to the right, followed by the injected heading:
Hi loveley lady, it’s microsoft\u0020\u00a0\u0020\u205f\u0020\u205f\u00a0\u0020\<h1>HACKED AND ABUSED</h1>
The leading text is the visible content. Because each Unicode character counts as one character against the limit, the whitespace costs no more than ordinary characters would.
Step 4: result in the mail client
The combination of whiteblocks and spaces pushed the payload to the right of the sidebar in an instance of Microsoft Outlook, so only the "legit" title of the e-mail was shown. The combination of whiteblocks and spaces pushed the payload to the right of the sidebar, so only the legit title was shown.
Root cause
The video title is accepted as HTML by the API and is encoded when rendered back in the web application, but the e-mail notification template inserts the title without encoding it, so the HTML is rendered in the message body. The character limit on the title does not prevent this, because Unicode whitespace counts as one character each and can be used to pad the payload out of the visible area. The report does not describe the server-side code, so the exact escaping mistake is not shown; the behaviour is consistent with the title being concatenated into the e-mail HTML without output encoding.
Impact
An attacker with an account can send e-mail from [redacted], a @microsoft.com address, containing attacker-controlled HTML in the body. The researcher frames this as abuse of a @microsoft.com domain for phishing, and as a way to craft extremely efficient spear-phishing mails. The second PoC pushes the payload out of the visible area, which the researcher saw as answering MSRC's objection that the payload was obvious in the mail name.
MSRC classified the issue as low severity and stated it would not be fixed. The researcher disagrees, arguing that more could be discovered and that the actual HTML context could be broken, spoofing the HTML itself. The report does not show script execution or any impact beyond injected HTML in the e-mail body.
Fix
No fix was applied: MSRC closed the case and the issue remained unpatched at the time of writing. The behaviour points to encoding the video title in the e-mail template.
Variants to test
- Upload a video with an HTML title such as
<h1>Hello world!</h1>and check the notification e-mail from the service. A positive result is the heading rendered as HTML in the message body rather than shown as text. - Try other HTML elements in the title, for example links or images, and check whether they render in the mail. A positive result is a clickable or loadable element controlled by the title.
- Use Unicode whitespace (
\u0020,\u00a0,\u205f) to pad the title and push the payload out of the visible area in a mail client. A positive result is a mail that shows only the plausible text while the injected element is rendered off to the side. - Test the same title field in every other place the service renders it: share pages, notifications and any other e-mail templates. A positive result is HTML rendering in any sink that the web application does not encode.
- Try to break out of the HTML context around the title in the e-mail template, for example by closing an enclosing element. A positive result is markup that changes the structure of the message rather than only adding an element inside it.
What happened, in plain words
A security researcher signed up to the Microsoft bug-bounty program, which is a scheme where Microsoft pays people for finding and reporting security problems in its products. He picked a Microsoft service called Microsoft Stream, which is a website for uploading and sharing video, reachable at stream.microsoft.com. He had never used it before.
When you upload a video to Stream, you give it a title. Later, the service sends you an e-mail to tell you the video has finished processing. That e-mail comes from [redacted], an address on Microsoft's own domain. The researcher discovered that whatever you put in the video title ends up inside that e-mail, and if the title contains HTML (the language web pages are written in), the e-mail shows it as real formatting instead of as plain text. That means an attacker with an account could send e-mails from a @microsoft.com address containing content they control, which is exactly what a phishing e-mail needs.
Microsoft's security team, the Microsoft Security Response Center (MSRC), decided the issue was low severity and would not fix it. This article walks through how the researcher found the problem, what he sent to Microsoft, and why he thinks the decision was wrong.


Einstein was right! (Probably)
The target and why it looked safe
Microsoft Stream is built on REST-style APIs. An API (application programming interface) is the set of addresses and rules a website's own pages use to talk to its servers. Think of it as the service counter at a shop: the web page you see is the shop floor, and the API is the counter where the page asks for data and hands data in. "REST-style" just means the API follows a common convention where each address represents a thing (a video, a user) and the type of request (get, create, change, delete) says what to do with it.
The service has regional backends (EU, Asia, US), meaning separate servers for different parts of the world. Its pages talk to those servers with XMLHttp-based requests, which is the browser mechanism behind what people usually call AJAX: a page updating itself without a full reload. The endpoints are token-secured and use several authentication headers. A token is a short piece of data, like a wristband at an event, that proves who you are on each request so you do not have to log in again every time. A header is a labelled line of extra information attached to each request, such as "here is my token".
The backend validated every character of a request, which is why the researcher initially assumed the application could not be insecure. That assumption is worth noticing: careful checking on one path does not mean every path is careful.
The feature at the centre of the report is the core one: file upload, together with the video title and the "Share your video" functionality. When a video is processed, the service sends notification e-mails from [redacted].
Setting up
The researcher used an old Microsoft account, a toolset of custom Python scripts, Burpsuite and a local web server used for documentation. Burpsuite is a program that sits between your browser and the website and lets you read and change every request, like a postal worker who opens each letter, shows it to you, and lets you rewrite it before delivery. A local web server is a small server running on your own machine; here it was used to keep notes and evidence.
The Python fuzzer used here was not yet public at the time of writing; the author says it would probably be released at github.com/si9int. Fuzzing means sending large numbers of slightly different inputs automatically and watching for anything unusual. No specific versions are given.
The methodology described is the same on every target:
- Reconnaissance: look around and map what the application does.
- Determine the correct application logic: work out what the application is supposed to do.
- Try to bypass the application logic in any way, not only security-related: find where it does something other than what it should.
- Take note of "bugs", meaning application errors.
- Try to expand these functional errors into security issues.
- Try to exploit these security issues.
- Try to prove some impact (low, medium, high).
- Try to expand the impact by chaining different issues or bugs.
The order matters. Steps 1 to 4 are about understanding and noticing; steps 5 to 8 are about turning a quirk into something that matters. Many beginners jump straight to step 6 and have nothing to exploit.
Finding it
Because Stream exposed "thousands" of parameters and different APIs, the researcher focused on the file upload. A parameter is a named value you send along with a request, such as the title of a video. After understanding the logic behind the different parameters, the Python fuzzer was used to fuzz them, looking at correlations or differences between valid and invalid input based on the HTTP response and the request time. The HTTP response is what the server sends back; the request time is how long it took. If a strange input produces a different response or a noticeably different delay, that is a clue that the input is being handled somewhere special.
Two observations came out of hammering the backend with different strings and payloads. A payload here simply means the input you send to test a behaviour.
- HTML is accepted by the API but rendered back encoded. For example,
<h1>Hello world!</h1>is a valid string for a video title. - Unicode is interpreted by the API, which allows injecting different spaces and whiteblocks while disregarding the character limit (1 Unicode character counts as 1 character).
Encoding, in this context, means turning characters that have a special meaning in HTML into harmless text. If < is encoded, the browser shows it as a literal less-than sign instead of starting a tag. Unicode is the standard that assigns a number to every character in every writing system, including many kinds of space. A character limit is a maximum length the application accepts for a field.
At that point there was no reflection, no anomaly and no error, only correct error handling and JavaScript functionality, so the researcher went to bed without a result. Reflection means your input coming back to you in the page; it is the usual first sign of this kind of bug.
The next morning the inbox contained many new mails from [redacted] saying that an uploaded video had been rendered successfully. In those mails the title <h1>Hello world!</h1> was executed and the HTML was rendered inside the e-mail. The title was rendered back encoded in the web application, but the HTML was rendered inside the e-mail. A template is the fixed layout a system fills in with values, here the video title, before sending the mail.
This is the key lesson of the whole report: the same value can be handled safely in one place and unsafely in another. The web page was careful; the e-mail was not.
Exploitation
Step 1: confirm the sink in the notification e-mail
A sink is the place where data finally gets used, in this case the e-mail body. The title <h1>Hello world!</h1> was accepted as a video title and, when the upload notification arrived from [redacted], the HTML was rendered in the message body. <h1> is the HTML tag for a top-level heading, so the text appeared large and bold instead of as literal angle brackets.
The researcher revisited the edit-video page and re-checked the "Share your video" functionality, then crafted a proof of concept and submitted it to the Microsoft Security Response Center. A proof of concept (PoC) is a minimal demonstration that the problem is real, usually the smallest set of steps that shows the effect.

The screenshot shows the proof of concept as submitted, described by the author as quick and dirty.
Step 2: first report and MSRC response
The first PoC abused a @microsoft.com domain for phishing purposes. Phishing is a fake message designed to look like it comes from someone trustworthy so the recipient clicks a link or hands over information. The value here is the sender domain: people are trained to trust mail from a company's own domain.
MSRC moved the report to N/A. Their argument was that the mail was named after the payload, so the phishing attempt was easy to spot. In other words, the mail was named after the payload, which gave the trick away. The quoted closure message is:
Gaurav:
"MSRC is no longer tracking this due to its severity and impact. We have closed this case."
Step 3: use the character limit to hide the payload
Remembering the character limit and the Unicode behaviour, the researcher crafted a second PoC. The idea is to fill the allowed length with invisible or near-invisible spaces so that the visible, believable text comes first and the injected HTML is pushed far to the right, out of sight.
The payload is a title string that starts with a plausible sentence, then uses Unicode spaces and whiteblocks to push the HTML far to the right, followed by the injected heading:
Hi loveley lady, it’s microsoft\u0020\u00a0\u0020\u205f\u0020\u205f\u00a0\u0020\<h1>HACKED AND ABUSED</h1>
Line by line, in plain words:
Hi loveley lady, it’s microsoftis ordinary text. It is what a recipient would see first, and it is written to look like a normal, friendly message. The spelling mistake is in the original.\u0020is a normal space, written in the escaped form.\u00a0is a no-break space: a space that looks like a space but is a different character.\u205fis a medium mathematical space, another kind of whitespace that looks blank on screen.- The sequence of these characters repeats and mixes, filling up the character budget with things that take up room but show nothing.
<h1>HACKED AND ABUSED</h1>is the injected HTML: a heading element with the text HACKED AND ABUSED inside it. If the e-mail renders HTML, this becomes a large heading.
Because each Unicode character counts as one character against the limit, the whitespace costs no more than ordinary characters would. That is the trick: the limit is measured in characters, not in visible width, so you can spend your whole allowance on things the reader cannot see.
Step 4: result in the mail client
The combination of whiteblocks and spaces pushed the payload to the right of the sidebar in an instance of Microsoft Outlook, so only the "legit" title of the e-mail was shown. The combination of whiteblocks and spaces pushed the payload to the right of the sidebar, so only the legit title was shown. A mail client is the program you read mail in; a sidebar is the column of folders and message names down the side. If the content is pushed past the edge of that column, the reader sees a normal-looking message name and nothing suspicious.
The researcher saw this as answering MSRC's objection that the payload was obvious in the mail name, though MSRC still classified the issue as low.
Root cause
The video title is accepted as HTML by the API and is encoded when rendered back in the web application, but the e-mail notification template inserts the title without encoding it, so the HTML is rendered in the message body. The character limit on the title does not prevent this, because Unicode whitespace counts as one character each and can be used to pad the payload out of the visible area. The report does not describe the server-side code, so the exact escaping mistake is not shown; the behaviour is consistent with the title being concatenated into the e-mail HTML without output encoding.
Concatenated means simply glued together: the template takes the fixed text, sticks the title in the middle, and sends the result. If the title contains markup, the markup becomes part of the message. Output encoding is the fix: before putting a value into HTML, replace the characters that have special meaning so they display as text.
Impact
An attacker with an account can send e-mail from [redacted], a @microsoft.com address, containing attacker-controlled HTML in the body. The researcher frames this as abuse of a @microsoft.com domain for phishing, and as a way to craft extremely efficient spear-phishing mails. Spear-phishing is phishing aimed at a specific person or group, using details that make the message believable to them.
The second PoC hides the injected content from casual view by pushing it out of the visible area, which addresses MSRC's objection that the payload was obvious in the mail name.
MSRC classified the issue as low severity and stated it would not be fixed. The researcher disagrees, arguing that more could be discovered and that the actual HTML context could be broken, spoofing the HTML itself. Breaking out of the HTML context means closing whatever element the title sits inside, so your markup changes the structure of the whole message rather than just adding a heading within it. Spoofing means making content look like it came from somewhere it did not.
The report does not show script execution or any impact beyond injected HTML in the e-mail body.
Fix
No fix was applied: MSRC closed the case and the issue remained unpatched at the time of writing. The behaviour points to encoding the video title in the e-mail template.
Variants to test
If you want to practise this kind of thinking on a service you are allowed to test, these are the directions the report points to. Each one names what a positive result looks like, so you know when to stop and report.
- Upload a video with an HTML title such as
<h1>Hello world!</h1>and check the notification e-mail from the service. A positive result is the heading rendered as HTML in the message body rather than shown as text. - Try other HTML elements in the title, for example links or images, and check whether they render in the mail. A positive result is a clickable or loadable element controlled by the title.
- Use Unicode whitespace (
\u0020,\u00a0,\u205f) to pad the title and push the payload out of the visible area in a mail client. A positive result is a mail that shows only the plausible text while the injected element is rendered off to the side. - Test the same title field in every other place the service renders it: share pages, notifications and any other e-mail templates. A positive result is HTML rendering in any sink that the web application does not encode.
- Try to break out of the HTML context around the title in the e-mail template, for example by closing an enclosing element. A positive result is markup that changes the structure of the message rather than only adding an element inside it.
Glossary
- API: the set of addresses and rules a website's own pages use to talk to its servers, like a service counter behind the shop floor.
- Authentication header: a labelled line attached to a request that carries proof of who is making it.
- Backend: the servers behind a website that do the actual work; the part users do not see.
- Bug bounty program: a scheme that pays people for finding and reporting security problems in a company's products.
- Burpsuite: a tool that sits between browser and website and lets you read and modify every request.
- Character limit: the maximum length a field accepts, counted in characters.
- Concatenation: gluing strings together end to end.
- Encoding (output encoding): replacing characters that have special meaning in HTML so they display as plain text instead of being interpreted.
- Endpoint: a specific address on a server that accepts requests.
- Fuzzing: automatically sending many slightly different inputs and watching for unusual responses or timings.
- Header: a labelled line of extra information attached to a request or response.
- HTML: the language web pages and HTML e-mails are written in, made of tags such as
<h1>. - HTML injection: getting your own HTML into a page or message that someone else will view.
- HTTP response: what a server sends back after a request.
- Impact: how much harm a security issue could cause, usually rated low, medium or high.
- Mail client: the program used to read e-mail, such as Microsoft Outlook.
- MSRC: the Microsoft Security Response Center, the team that handles security reports about Microsoft products.
- Parameter: a named value sent with a request, such as a video title.
- Payload: the input you send to test a behaviour.
- Phishing: a fake message made to look trustworthy so the recipient clicks a link or gives away information.
- Proof of concept (PoC): a minimal demonstration that a problem is real.
- Reconnaissance: the mapping-out phase at the start of testing, where you learn what an application does.
- Reflection: your input coming back to you in a page or message.
- REST-style: a common convention for APIs where each address represents a thing and the request type says what to do with it.
- Severity: the rating of how serious an issue is.
- Sink: the place where data finally gets used, such as an e-mail body.
- Spear-phishing: phishing aimed at a specific person or group, using details that make it believable to them.
- Spoofing: making content appear to come from somewhere it did not.
- Template: a fixed layout that a system fills in with values before sending.
- Token: a short piece of data that proves who you are on each request, like a wristband at an event.
- Unicode: the standard that assigns a number to every character in every writing system, including many kinds of space.
- XMLHttp-based request: a request made by a page in the background, without reloading the whole page; the mechanism behind AJAX.