SlowMist: Analysis and Security Suggestions for the IOTA Major Coin Stolen Incident

A few days ago, we noticed that IOTA suspended the mainnet. Although we also knew that IOTA users had suffered a coin theft attack earlier, we didn’t expect that IOTA officials would suspend the mainnet to conduct the blocking and investigation of this attack. It seems that the problem is serious. Moreover, on 19/02/2020, we analyzed some of the clues officially disclosed on status.iota.org and began to independently investigate the specific cause of this serious security incident.

After analyzing the release of the new version of Trinity — the official wallet of IOTA, we conducted a version comparison on its GitHub. We noticed that MoonPay, a third-party component, was removed. Besides, we also noticed that the Trinitiy desktop wallet was developed based on Electron. Our security experience tells us that this may be a big trap, so we released some speculations on 2020/02/19 :

Today (2020/02/22), we noticed that some details were officially disclosed, which basically confirmed our speculation.

Pay attention to this paragraph:

The attacker used MoonPay’s Cloudflare API Key to carry out a series of hijacking attacks subsequently. The IOTA stolen is estimated to reach 8.55 Ti (8550000 MIOTA, MIOTA is now the default minimum transaction unit of the exchange, and the current price is 0.267 USD / MIOTA). According to our historical experience, if the web parses and uses Cloudflare to provide service and its Cloudflare account permissions are controlled, then a perfect man-in-the-middle attack and implantation of malicious JavaScript can be possible. The Trinity desktop wallet is based on Electron. A perfect JavaScript execution environment. No exceptional unauthorized operations are required. JavaScript can perform everything the user or Trinity wallet can do, including theft of passwords and seeds, etc.

Since we are not like IOTA and the MoonPay official, they have sufficient log records to obtain the attack process completely, and we can only output the above speculations and analysis related through what we can reach. For the rest, we hope that the official can release the complete details and resume the mainnet as soon as possible.

We want to provide some necessary security views and suggestions here:

  1. Third parties can be evil, by default, they are not supposed to be trusted. In the process of software security development, must be alert to the dependencies on the third-party, including third-party components and third-party JavaScript links.
  2. Third-party CDN / WAF services such as Cloudflare are excellent and powerful, but if users do not securely manage their account permissions, their Web services will encounter perfect man-in-the-middle attacks
  3. A fatal flaw in the official wallet of the public chain may bring down a public chain. While on-chain security is concerned, off-chain security cannot be ignored. They are a whole, which is why we are concerned about the blockchain ecological security, Not just the on-chain security of the blockchain itself
  4. As a user of IOTA’s official wallet Trinity, follow the official instructions to complete the security hardening work as soon as possible, not much to say about this.

Note: Dominik Schiener, the co-founder of the IOTA Foundation, said: “The attack was made using MoonPay’s problematic JavaScript.「 The biggest mistake Trinity Wallet made was, not integrating the NPM application package and not appropriately performing security audits to the integration. 」 “From the perspective of a third-party independent security audit, we believe that this statement is not rigorous. In the history of the development of cryptocurrencies, the number of cases of cryptocurrency theft caused by third-party sources referenced in the NPM package are not rare. For example, the well-known “event-stream” incident.

Related Links:

Trinity Attack Incident Part 1: Summary and next steps

Trinity Attack Incident Part 2: Trinity Seed Migration Plan

Trinity Attack Incident Part 3: Key Learnings & Takeaways

IOTA Status Page

How do you think that the event-stream of the NPM package has been tampered with by hackers and found to contain malicious code?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
SlowMist

SlowMist is a Blockchain security firm established in 2018, providing services such as security audits, security consultants, red teaming, and more.