Skip to content
XSS Disclosed report Beginner

DOM Based XSS in mycrypto.com

The 'connected successfully' message on mycrypto.com was inserted into the page without sanitisation, allowing an attacker to inject arbitrary HTML via the URL fragment. The reporter could not execute JavaScript because an AngularJS sanitiser stripped malicious href attributes, but HTML injection still enabled phishing, content spoofing, and clickjacking.

bigshaq Follow

Originally disclosed on HackerOne

  • Triaged in 43 hours
  • Fixed in 3 days
  • Disclosed after 7 days

##Description & PoC The "connected successfully" message is printed out without any output sanitation:

detection.png
detection.png From the original on HackerOne

This is how it's being printed(this code snippet is taken from mycrypto-master.js, line 4072):

vuln_line_x.png
vuln_line_x.png From the original on HackerOne

An attacker can simply put his payload at the link and it'll be embedded within the page output:

https://mycrypto.com/#send-transaction<div/class="header__wrap"><a/href=javascript:alert(0)><h1>pwn3d</h1></a><img/src=//unskid.me/dist/jesus.gif></div>
4.png
4.png From the original on HackerOne

##Notes As you can see, I couldn't get any javascript running, that's because the application has an AngularJS XSS protection that goes through ALL the href\src\similiar attributes in the DOM and checks if it has a malicious content/XSS attempts with a tough regex(based on a whitelist). Couldn't bypass that. Some screenshots of the "angular-XSS-blocker" from the chrome debugger :

angular_1.png
angular_1.png From the original on HackerOne
angular_2.png
angular_2.png

Once it's triggered and see a malicious attempt(isImg==false), the malicious <a> tag:

<a href="javascript:alert(0)">click here</a>

turns into:

<a>click here</a>

Impact

Although i did not get running javascript i still think that it's worth reporting because, well, still..anyone can inject other HTML code in that part of the application and it should be encoded. It can lead to other things like phishing/content spoofing/clickjacking.

The hacker selected the Cross-site Scripting (XSS) - DOM weakness. This vulnerability type requires contextual information from the hacker. They provided the following answers:

URL https://mycrypto.com/#here

Verified Yes

The original report as published on HackerOne, by bigshaq. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

How it worked

Impact

Although JavaScript execution was blocked by the AngularJS sanitiser, an attacker could still inject HTML to conduct phishing, content spoofing, or clickjacking.

What the attacker needed

Victim clicks a crafted link

The fix

The application should encode or sanitise the URL fragment before inserting it into the DOM.

How it was found

  1. Craft a URL with a payload in the fragment after #send-transaction.
  2. Open the crafted URL in a browser.
  3. Observe the injected HTML rendered in the page, with the AngularJS sanitiser removing the javascript: href.

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 report has not been written yet. The Original tab links to the source.

When a website takes part of the address you type (the bit after the #) and puts it directly into the page without cleaning it, an attacker can add their own HTML. Here the site did clean dangerous links, so script did not run, but the attacker could still add fake content to trick users.

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 bigshaq

View all

4 more disclosed reports, best first.

More from MyCrypto

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.