CVE-2021–34506: How We Are Able To Hack Any Company By Sending Message - $20,000 Bounty
The Microsoft Edge built-in translator failed to sanitise HTML before translating, so an image tag with an error handler in a page's text was executed as JavaScript. An attacker could get script to run on any site a victim visited in Edge with auto-translate on, by placing a payload in reflected content such as a profile name or review.
Published on cyberxplore.medium.com
Hello Folks , I hope everyone is doing well in this pandemic & making full use of it for learning new stuff in their daily life . so this a story about hacking into any companies even the big ones are on list like facebook , google , microsoft etc. so how does this all begin to know this we need to start from scratch .
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 Edge ships with an internal translator that comes pre-installed. When a page is in a language other than the one the user expects, Edge offers to translate it, and the translation is performed by that built-in component rather than by a third-party extension. The researchers reasoned that browser extensions have universal access to any site: they can read the complete DOM, cookies and anything else JavaScript can reach.
The target of the report is that translator. The bug class is Universal XSS (uXSS): unlike an ordinary reflected or stored XSS, a uXSS lives in the browser or in a browser extension, so the malicious script runs in the context of any site the browser visits, not just the one that reflected the payload. The report was filed with Microsoft and later assigned CVE-2021-34506.
Setup
The work started on 3 June 2021, while the two researchers, Vansh Devgan (@Th3Pr0xyB0y) and Shivam Kumar Singh (@MrRajputHacker), were hunting together on a mail.ru subdomain through the HackerOne program. That program is in Russian, so translation was a practical necessity. The team's normal tooling is Firefox with Burp Suite, and Firefox does not translate pages the way Chrome does, which made the target awkward to work with.
Looking for a Firefox translation extension, they found that many such extensions had been removed because they contained vulnerable code. That led to the thought that an extension with universal access to every site could read the complete DOM, cookies and anything else JavaScript can reach. They dropped the mail.ru subdomain and moved to Microsoft Edge, which has a bounty program, and specifically to its new built-in translator.
For reproduction the report lists these preconditions:
- Microsoft Edge, version 91.0.864.48 (Official build) (arm64).
- A local file named
POC.htmlserved over HTTP. - Python 3 available to start a static server.
- The translator's offer to translate the page, which the user has to accept.
Finding it
The researchers returned to the same mail.ru site, which was full of XSS payloads, and translated it in Edge. On translation, many popups appeared. The same page in Chrome produced no popups. That difference pointed at the Edge translator rather than at the site.
Digging into the translator, they found that it took HTML tags containing an img tag without sanitising the input or converting the payload into text before translating. The translator was consuming the payload and executing it as JavaScript, because there was no validation step that sanitised the content or converted the whole DOM to text before processing it for translation. The report names startPageTranslation as the affected function and says a code snippet of the affected code was included, but the snippet itself is not reproduced in the text.
To confirm, they built a POC.html file containing text in a different language together with the well-known payload:
"><img src=x onerror=alert(1)>
The report says the full contents of POC.html were shown as a code snippet, but that snippet is not present in the text.
Exploitation
Step 1: create the page
Download the POC.html file from the snippet, or paste the code into a file, name it POC.html and save it.
Step 2: serve it over HTTP
Start a Python server in the same folder as the file, on localhost:
python3 -m http.server 80
The report explains why a server is needed for a plain HTML file: the translator sometimes does not offer to translate a page opened directly from disk, possibly because document.location is about:html in that case.
Step 3: open it in Edge
Open Microsoft Edge (Version 91.0.864.48 (Official build) (arm64)) and visit:
http://localhost/POC.html
The report notes that by the time of writing the browser had most likely been updated to a secure version, so the reader may not be able to reproduce it.
Step 4: accept the translation
The translator shows a message that the page is in another language and asks whether to translate it. Click the translate button.
Step 5: the payload runs
The result is alert(1). The report also references a proof-of-concept video showing the same flow.
Root cause
The translator processes page content for translation without sanitising it or converting it to text first. Any HTML in the page, including an img tag with an event handler, is passed through and ends up executing as JavaScript in the page's context. Because the translator is part of the browser and runs on every page it is asked to translate, the resulting XSS is not tied to the origin that supplied the markup: it is universal. The report points at startPageTranslation as the function involved and says the affected code was included as a snippet, but the snippet is not in the text, so the exact defect inside that function is not shown here.
Impact
The report summarises the impact in four statements:
- Any page that reflects
"><img src=x onerror=alert(1)>, or any other XSS payload, is vulnerable. Reflection is all that is needed. - A person from another country who does not read English and visits an English site about XSS is vulnerable, because they will translate the page and the payload will fire.
- All Edge users are vulnerable to XSS that can trigger on any website.
- Anyone who receives an email or message whose content is in a different language plus an XSS payload is vulnerable.
The report then sketches how the same primitive could be aimed at large platforms, given a victim on Edge with auto-translate on:
- Facebook: create a profile whose name is in a different language plus an XSS payload, and send a friend request to the victim. When the victim views the profile, the auto-translation fires the payload.
- Google: write a review for a company, HackENews, with a different language plus an XSS payload. Anyone browsing that review link gets the popup through auto-translation.
- YouTube: upload a video and enter a comment with an XSS payload plus a different language. Anyone viewing the video in Edge gets the popup. The report notes that YouTube and Google share the same POC video.
- Windows Store applications: web-based applications such as Instagram distributed through the Windows Store are also affected, because the Store ships applications with the same Microsoft Edge translator that triggers the uXSS.
The report states two conditions for a remote exploit: the person must be using Microsoft Edge, and the person must have auto-translate on. It also notes that many other possibilities exist for this attack vector.
Fix
Microsoft handled the issue on the following timeline:
| Date | Event |
|---|---|
| 3 June 2021 | Report sent to Microsoft |
| 7 June 2021 | Reply from Microsoft, reviewing |
| 8 June 2021 | Additional impact information sent |
| 15 June 2021 | Report triaged |
| 17 June 2021 | $20,000 bounty awarded |
| 19 June 2021 | Pre-release patch |
| 24 June 2021 | Patch update pushed and CVE assigned as CVE-2021-34506 |

The image is the closing banner of the write-up, captioned as the uXSS Microsoft Edge Translator bounty, placed after the timeline and the pointer to Microsoft's release notes and acknowledgement for CVE-2021-34506.
The report does not describe the content of the patch.
Variants to test
- Other built-in translation or summarisation features. Any browser or OS component that reads page text and re-renders it can carry the same flaw. A positive result is a payload reflected in a page, followed by the feature's own action (translate, summarise, read aloud) executing it without the page's own scripts being involved.
- Third-party translation extensions. The report notes that many Firefox translation extensions were removed for containing vulnerable code. Install one in a test profile, load a page with a reflected payload, trigger translation, and watch for execution in the page context.
- Store-packaged web applications. The report says Windows Store applications ship with the same Microsoft Edge translator. Test a packaged web app on a page with a reflected payload and auto-translate enabled; a popup in the packaged app confirms the same primitive.
- User-generated content on large platforms. Profile names, reviews, comments and messages are all surfaces where a payload plus foreign-language text can reach a victim who auto-translates. A positive result is execution when the victim views the content, with no interaction beyond the automatic translation.
- Reflection-only pages. Because the report says reflection is sufficient, look for any endpoint that echoes input into the page, then have a victim with auto-translate on load it. Execution without any site-specific XSS defence being bypassed is the signal.
What happened, in plain words
Two security researchers, Vansh Devgan (@Th3Pr0xyB0y) and Shivam Kumar Singh (@MrRajputHacker), found a bug in the built-in translator that ships with Microsoft Edge. The translator is the feature that notices a page is in a foreign language and offers to rewrite it in yours. The bug was that the translator took HTML tags without sanitising the input or converting the payload into text before translating. That meant a page containing a small piece of malicious markup could make the browser run a script, and the script would run on any website, not just the one that contained the markup. Microsoft patched it and paid a $20,000 bounty. The bug was given the identifier CVE-2021-34506.
This article walks through the whole story from zero: what the researchers were doing, how they noticed the bug, how they proved it, what damage it could have caused, and how Microsoft responded. Every technical term is explained the first time it appears, and there is a glossary at the end.
Background: what a translator in a browser does
When you open a web page written in a language you do not read, modern browsers can offer to translate it for you. In Chrome this is a Google service. In Microsoft Edge, the browser has its own translator built in, pre-installed, so you do not have to install anything. When Edge thinks a page is in another language, it shows a small bar asking whether you want it translated. If you click yes, the browser reads the page and replaces the text with a translation.
To do that, the translator has to look at the page's content. A web page is not a picture; it is a structured document. The browser builds an in-memory model of that document called the DOM (Document Object Model). Think of the DOM as a family tree of everything on the page: headings, paragraphs, images, links, and the text inside them. The translator reads this tree, pulls out the text, translates it, and puts it back.
Because the translator is part of the browser itself, it can see the DOM of whatever page you are on. If you are on your bank's site, it can read that page. If you are on a social network, it can read that page too. That is the same access that JavaScript running on the page has. JavaScript is the programming language that web pages use to be interactive. It can read the page, change it, and read things like cookies (small pieces of data a site stores in your browser, often used to keep you logged in).
The report calls this "universal access": the translator is not limited to one website. It works everywhere, because it is part of the browser.
The bug class: Universal XSS
The bug the researchers found is called Universal XSS, or uXSS. To understand it, you first need to know what ordinary XSS (Cross-Site Scripting) is.
XSS is a class of bug where a website takes something a user supplied, such as a search term or a comment, and puts it into a page without cleaning it up. The script then runs as if it came from that website. An attacker can use that to steal cookies, change what the page shows, or act as the logged-in user.
Ordinary XSS is tied to one website: the script runs in the context of the site that reflected or stored the malicious input. Universal XSS is different. The flaw is not in a website but in the browser or in a browser extension. Because the browser component runs on every page, the script it runs is not tied to any one site. It can affect any site the browser visits. That is why it is called universal.
The report describes it this way: unlike common XSS attacks, uXSS exploits client-side vulnerabilities in the browser or browser extensions in order to generate an XSS condition and execute malicious code. When such a vulnerability is exploited, the behaviour of the browser is affected and its security features may be bypassed or disabled.
A useful comparison: ordinary XSS is like a faulty lock on one shop's door. Universal XSS is like a faulty master key that opens every shop in the mall.
How the researchers got there
On 3 June 2021, the two researchers were hunting for bugs together on a subdomain of mail.ru, through a program listed on HackerOne. HackerOne is a platform where companies publish bug bounty programs: rules and rewards for people who find and report security problems in their systems. A subdomain is a smaller site under a main domain, for example blog.example.com under example.com.
The mail.ru program is in Russian. The researchers do not read Russian, so they needed translation. Their normal toolkit is the Firefox browser plus a tool called Burp Suite, which lets you inspect and modify the traffic between your browser and a website. Firefox does not translate pages the way Chrome does, so working with a Russian site was awkward.
They looked for a Firefox extension to translate pages. An extension is a small add-on you install in your browser to add features. While searching, they found that many translation extensions had been removed from the store because they contained vulnerable code. That got them thinking: an extension with access to every site could read the complete DOM, cookies, and anything else JavaScript can reach. If such an extension had a bug, the impact would be huge.
They dropped the mail.ru subdomain and turned to Microsoft Edge, which has a bug bounty program, and specifically to its new built-in translator.
Finding the bug
They went back to the same mail.ru site, which was full of XSS payloads. A payload here means the piece of text an attacker injects to make something happen, usually a small script. They translated the page in Edge. As soon as the translation happened, many popups appeared. They tried the same page in Chrome, and no popups appeared. That difference was the clue: the problem was not the website, it was the Edge translator.
Digging into the translator, they found that it took HTML tags containing an img tag without sanitising the input or converting the payload into text before translating. Sanitising means cleaning input so that dangerous parts are removed or neutralised. HTML tags are the markup that tells a browser what each part of a page is, such as <p> for a paragraph or <img> for an image. The translator was consuming the payload and executing it as JavaScript, because there was no validation step that sanitised the content or converted the whole DOM to text before processing it for translation.
The report names startPageTranslation as the affected function. A function is a named block of code that does a specific job; this one appears to be the part of the translator that starts translating a page. The report says a code snippet of the affected code was included, but the snippet itself is not reproduced in the text, so the exact defect inside that function is not shown here.
To confirm the bug, they built a POC.html file. POC stands for proof of concept: a small, controlled demonstration that a bug is real. The file contained text in a different language together with the well-known payload:
"><img src=x onerror=alert(1)>
Line by line, in plain words:
">closes an attribute and a tag early. If this text lands inside an HTML attribute, the quote ends the attribute and the>ends the tag, so whatever follows is treated as new markup rather than as text.<imgstarts an image element.src=xtells the browser the image is at the addressx. That address does not exist, so the image fails to load.onerror=alert(1)is an event handler. An event handler is a piece of JavaScript that the browser runs when something happens. Here, the event is the image failing to load. When it fails, the browser runsalert(1), which shows a popup box with the number 1 in it.>closes the image tag.
The report says the code snippet for POC.html is below, but that snippet is not present in the text.
Exploitation: the steps to reproduce
The report lays out the reproduction in numbered steps. Before starting, these conditions must be met:
- Microsoft Edge, version 91.0.864.48 (Official build) (arm64).
- A local file named
POC.htmlserved over HTTP. - Python 3 available to start a static server.
- The translator's offer to translate the page, which the user has to accept.
Step 1: create the page
Download the POC.html file from the snippet, or paste the code into a file, name it POC.html and save it. The file contains foreign-language text plus the payload above. The foreign-language text is there to make the translator think the page needs translating.
Step 2: serve it over HTTP
Start a Python server in the same folder as the file, on localhost:
python3 -m http.server 80
Line by line:
python3runs the Python 3 interpreter.-m http.servertells Python to run its built-in HTTP server module. An HTTP server is a program that hands files to a browser when the browser asks for them. HTTP is the protocol browsers and servers use to exchange web pages.80is the port number. A port is like a numbered door on a computer; port 80 is the standard door for HTTP.
The report explains why a server is needed for a plain HTML file: the translator sometimes does not offer to translate a page opened directly from disk, possibly because document.location is about:html in that case. document.location is the browser's record of the current page's address. When you open a file directly from your disk, the address is not a normal web address, and the translator may not treat it as a page worth translating. Serving it over HTTP gives it a normal web address.
Step 3: open it in Edge
Open Microsoft Edge (Version 91.0.864.48 (Official build) (arm64)) and visit:
http://localhost/POC.html
Line by line:
http://says to use the HTTP protocol.localhostmeans this computer. It is the address a computer uses to talk to itself./POC.htmlis the file being requested from the server you just started.
The report notes that by the time of writing the browser had most likely been updated to a secure version, so the reader may not be able to reproduce it.
Step 4: accept the translation
The translator shows a message that the page is in another language and asks whether to translate it. Click the translate button. This is the moment the translator reads the page and processes it.
Step 5: the payload runs
The result is alert(1): a popup appears. That popup is the proof. The translator took the markup and ran it. The report also references a proof-of-concept video showing the same flow.
Why it works: the root cause
The translator processes page content for translation without sanitising it or converting it to text first. Any HTML in the page, including an img tag with an event handler, is passed through and ends up executing as JavaScript in the page's context. Because the translator is part of the browser and runs on every page it is asked to translate, the resulting XSS is not tied to the origin that supplied the markup: it is universal.
A comparison: imagine a translator who is supposed to read a letter aloud in another language. If the letter contains a note saying "shout this out", a careful translator reads the note as text. A careless translator follows the instruction. The Edge translator followed the instruction.
The report points at startPageTranslation as the function involved and says the affected code was included as a snippet, but the snippet is not in the text, so the exact defect inside that function is not shown here.
Impact: what an attacker could do
The report summarises the impact in four statements:
- Any page that reflects
"><img src=x onerror=alert(1)>, or any other XSS payload, is vulnerable. Reflection is all that is needed. Reflection means the site echoes back something you sent it, such as a search term shown on the results page. - A person from another country who does not read English and visits an English site about XSS is vulnerable, because they will translate the page and the payload will fire.
- All Edge users are vulnerable to XSS that can trigger on any website.
- Anyone who receives an email or message whose content is in a different language plus an XSS payload is vulnerable.
The report then sketches how the same primitive could be aimed at large platforms, given a victim on Edge with auto-translate on. Auto-translate is the setting that translates pages automatically without asking each time.
- Facebook: create a profile whose name is in a different language plus an XSS payload, and send a friend request to the victim. When the victim views the profile, the auto-translation fires the payload.
- Google: write a review for a company, HackENews, with a different language plus an XSS payload. Anyone browsing that review link gets the popup through auto-translation.
- YouTube: upload a video and enter a comment with an XSS payload plus a different language. Anyone viewing the video in Edge gets the popup. The report notes that YouTube and Google share the same POC video.
- Windows Store applications: web-based applications such as Instagram distributed through the Windows Store are also affected, because the Store ships applications with the same Microsoft Edge translator that triggers the uXSS.
The report states two conditions for a remote exploit: the person must be using Microsoft Edge, and the person must have auto-translate on. It also notes that many other possibilities exist for this attack vector.
How Microsoft fixed it
Microsoft handled the issue on the following timeline:
| Date | Event |
|---|---|
| 3 June 2021 | Report sent to Microsoft |
| 7 June 2021 | Reply from Microsoft, reviewing |
| 8 June 2021 | Additional impact information sent |
| 15 June 2021 | Report triaged |
| 17 June 2021 | $20,000 bounty awarded |
| 19 June 2021 | Pre-release patch |
| 24 June 2021 | Patch update pushed and CVE assigned as CVE-2021-34506 |
Triaged means the security team confirmed the report is valid and started handling it. A patch is a software update that fixes a bug. A CVE is a public identifier for a known security vulnerability, so people can refer to it unambiguously.

The image is the closing banner of the write-up, captioned as the uXSS Microsoft Edge Translator bounty, placed after the timeline and the pointer to Microsoft's release notes and acknowledgement for CVE-2021-34506.
The report does not describe the content of the patch.
Variants to test
These are the same kinds of places where the same idea could show up again. They are listed here as directions for further testing, not as confirmed findings.
- Other built-in translation or summarisation features. Any browser or OS component that reads page text and re-renders it can carry the same flaw. A positive result is a payload reflected in a page, followed by the feature's own action (translate, summarise, read aloud) executing it without the page's own scripts being involved.
- Third-party translation extensions. The report notes that many Firefox translation extensions were removed for containing vulnerable code. Install one in a test profile, load a page with a reflected payload, trigger translation, and watch for execution in the page context.
- Store-packaged web applications. The report says Windows Store applications ship with the same Microsoft Edge translator. Test a packaged web app on a page with a reflected payload and auto-translate enabled; a popup in the packaged app confirms the same primitive.
- User-generated content on large platforms. Profile names, reviews, comments and messages are all surfaces where a payload plus foreign-language text can reach a victim who auto-translates. A positive result is execution when the victim views the content, with no interaction beyond the automatic translation.
- Reflection-only pages. Because the report says reflection is sufficient, look for any endpoint that echoes input into the page, then have a victim with auto-translate on load it. Execution without any site-specific XSS defence being bypassed is the signal.
Glossary
- Auto-translate: a browser setting that translates pages automatically without asking each time.
- Bounty: a reward, usually money, paid by a company to someone who reports a security bug in its systems.
- Bug bounty program: a set of rules and rewards a company publishes for people who find and report security problems.
- Burp Suite: a tool that lets you inspect and modify the traffic between your browser and a website.
- Cookie: a small piece of data a website stores in your browser, often used to keep you logged in.
- CVE: a public identifier for a known security vulnerability, so people can refer to it unambiguously.
- DOM: the browser's in-memory model of a web page, a tree of all its elements and text.
- Event handler: a piece of JavaScript the browser runs when something happens, such as an image failing to load.
- Extension: a small add-on you install in your browser to add features.
- Function: a named block of code that does a specific job.
- HTML: the markup language that tells a browser what each part of a page is.
- HTML tag: a piece of HTML markup such as
<p>or<img>that marks up part of a page. - HTTP: the protocol browsers and servers use to exchange web pages.
- HTTP server: a program that hands files to a browser when the browser asks for them.
- JavaScript: the programming language web pages use to be interactive.
- localhost: the address a computer uses to talk to itself.
- Patch: a software update that fixes a bug.
- Payload: the piece of text an attacker injects to make something happen, usually a small script.
- POC (proof of concept): a small, controlled demonstration that a bug is real.
- Port: a numbered door on a computer that network traffic uses; port 80 is the standard door for HTTP.
- Reflection: when a website echoes back something you sent it, such as a search term shown on the results page.
- Sanitising: cleaning input so that dangerous parts are removed or neutralised.
- Subdomain: a smaller site under a main domain, for example
blog.example.comunderexample.com. - Triaged: confirmed as valid by a security team and moved into handling.
- Universal XSS (uXSS): an XSS bug that lives in the browser or a browser extension, so the script runs on any site the browser visits, not just one site.