Cointime

Download App
iOS & Android

Modal Phishing in Web3 Mobile Wallets

Validated Project

We recently identified a new type of phishing technique that can be used to mislead victims about the identity of connected dApps. We name this novel phishing technique Modal Phishing. Attackers can send crafted messages to mobile wallets, impersonating a legitimate dApp and tricking victims into approving transactions by showing misleading information in the modal of mobile wallets. This phishing technique is being actively used in the wild. We communicated with the corresponding vendor to address the risks. New Verify APIs will be released as mitigations.

What is Modal Phishing?

During CertiK’s security research on mobile wallets, we noticed that certain user interface (UI) elements of crypto wallets can be controlled by attackers to conduct phishing attacks. We name this phishing technique Modal Phishing, as the attacker mainly targets the modal window of crypto wallets.

A modal (or modal window) is a UI element used in mobile applications. The modal normally appears as a window sitting on top of an application's main window. Such a design is often used for users to perform a quick operation, such as approving/rejecting transaction requests on cryptocurrency wallets. A typical modal design on crypto wallets often includes necessary information for users to examine the incoming request, and buttons to approve or deny the request.

Real Transaction Approval Modal vs Phishing Transaction Approval Modal

In the above screenshots, we show how a regular transaction approval modal window appears on Metamask. When a new transaction request is initialized by a connected decentralized application (dApp), the wallet renders a new modal window asking for the user’s confirmation. As shown in the screenshot on the left, the modal window normally contains the identity of the requester, such as a website address (localhost), icon, and so on. Some wallets, such as Metamask, also show key information about the request, which is shown tagged “Confirm” to suggest to the user that this is a regular transaction request.

However, these UI elements can be controlled by attackers to carry out modal phishing attacks. On the right screenshot, we can see that the attacker can change the transaction details and camouflage the transaction request to be a “Security Update” request from “Metamask” to trick users into approving it.

As shown in these screenshots, there are multiple UI elements that can be manipulated by attackers. In this blog, we will introduce two phishing scenario examples and identify the UI elements that attackers can control. More specifically, we show that:

  1. Attackers can control dApp information UI elements (name, icon, etc) if the Wallet Connect protocol is used,
  2. Attackers can control smart contract information UI elements in certain wallet applications.

Examples of Attacker Controlled Modals and Associated Information Source (dApp Info & Method Name)

Example 1: dApp Phishing via Wallet Connect

Wallet Connect protocol is a popular open-source protocol used to connect a user's wallet with a dApp via a QR code or deep linking. Users can connect their wallet to dApps via the Wallet Connect protocol and then interact with the protocol.

During the pairing process between the crypto wallet and the dApp, we noticed that the crypto wallet launches a modal window to show users the meta information of the incoming pairing request. This includes the dApp name, website address, icon, and description. The way crypto wallet presents such information are often customized but usually the dApp name, icon and website address is included for the user to review.

However, this information is provided by the dApp, wallets do not verify if the information given is legitimate. In a phishing attack, a fake dApp can claim to be another dApp and trick users into connecting to it before initiating transaction requests. In this video, we show how an attacker can claim to be Uniswap dApp to connect with a Metamask wallet and trick users into approving the incoming transactions.

In our demo, we show how the attacker spoofs the Uniswap dApp. During the pairing process, the modal window shown in-wallet presents the legitimate Uniswap dApp name, website url, and website icon. Due to the use of the https scheme in the URL, a padlock icon is also shown to further legitimize the modal window. After the pairing process, whenever the victim wants to perform a swap operation on the fake Uniswap website, the attacker can replace the transaction request parameters (such as destination address and transaction amount) and steal funds from the victim.

Note that although the modal design varies on different wallets, the attacker can always control the meta information. Below we show how the pairing approval modal looks when we connect ZenGo and 1Inch wallet to the phishing dApp.

 Modal Phishing: Fake dApp Connecting to Zengo and 1Inch Wallets

Now knowing that the pairing and transaction modal windows can be manipulated by attackers, we can see that such an attack can be used to convince users that the transaction request comes from a legitimate dApp. As shown in the following screenshot, we create a fake dApp which claims to be “Metamask” and initiate a phishing smart contract. We show that an attacker can impersonate a dApp from Metamask or Uniswap in the transaction approval modal.

As shown in the above example, the widely used Wallet Connect protocol does not verify the legitimacy of paired dApp information. The manipulated meta information is further consumed by wallet apps and presented to users which can be used as Modal Phishing. As a potential mitigation, the Wallet Connect protocol should verify the dApp information ahead of time. Wallet Connect developers have acknowledged this issue and are working on a solution.

Example 2: Smart Contract Info Phishing via MetaMask

You may have already noticed that under the icon or website name on the approval modal from Metamask is another view showing an unfixed string, such as “Confirm” or “Unknown Method”. This UI element is designed by Metamask to identify the corresponding transaction type.

While rendering the transaction approval modal, Metamask reads the smart contract's signature bytes and queries the corresponding method name using an on-chain method registry, as shown in the following code. This, however, also creates another UI element on modal that can be controlled by attackers.

MetaMask source code reading smart contract function name by signature bytes
MetaMask’s smart contract method name description

Phishing campaigns that utilize malicious modal windows have been gaining attention on Twitter recently.

We can see a transaction request modal on Metamask marked as “Security Update”. The attacker built a phishing smart contract which has a SecurityUpdate payable function and allows the victim to transfer funds into this smart contract. The attacker also used SignatureReg to register the method signature into the human-readable string “SecurityUpdate”. As previously mentioned, when Metamask parses this phishing smart contract it queries the corresponding function methods using the function signature bytes and presents it in the approval modal to users.

As we can see from the transactions of this smart contract, this particular phishing smart contract has been used for over 200 days.

Combining these controllable UI elements, the attacker can create a very convincing transaction request which is shown as a “Security Update” request from “Metamask” seeking the user’s approval.

Phishing Transaction Approval Modal

In the above example, we show how smart contract information related UI elements on wallets can be manipulated by phishing attackers.

Although we use Metamask as the example here, other wallets may also have similar vulnerabilities. The developers of wallet applications should always be careful about what to present to users, and take precautions to filter out the possible words that can be used in phishing attacks.

Conclusion

In this blog, we show that a common UI component – modal windows – on crypto wallets cannot be blindly trusted. Certain UI elements from modal windows can be manipulated by attackers to create very convincing phishing scenarios. Thus we name this new phishing technique Modal Phishing.

The root cause of such an attack is that the wallet applications do not thoroughly verify the presented UI elements. For example, the wallet application simply trusts the metadata from Wallet Connect's SDK and presents it to users. The Wallet Connect SDK does not verify the incoming metadata either, which in certain situations allows the rendered metadata to be controlled by an attacker. In Metamask, we can see the similar attacking principle is also abused by attackers to show fraudulent smart contract function method names in modal windows.

In general, we believe the developers of wallet applications should always assume incoming data is untrustworthy. Developers should carefully choose what information to present to the user and verify the legitimacy of this information. Users can play their part by maintaining a skeptical attitude to every unknown transaction request.

Read more: https://www.certik.com/resources/blog/4uOOlTALvO5p7aNm1X4rey-modal-phishing-in-web3-mobile-wallets

Comments

All Comments

Recommended for you

  • Blast DEX Thruster receives $7.5 million in seed round funding

    The decentralized trading protocol Thruster based on Blast raised $7.5 million in seed funding led by Pantera Capital, bringing Thruster's valuation to $70 million. Angel investors include Santiago Santos, Frax founder Sam Kazemian, Pendle founder TN Lee, Stacked founder Alex Lin, Renzo founder Kratik Lodha, and Axelar founder Georgios Vlachos also participated in this round of funding.

  • Hong Kong Treasury Secretary: Will submit a draft bill on stablecoin and virtual asset over-the-counter trading services to the Legislative Council

    According to a report by Caixin, Hong Kong Financial Secretary Paul Chan Mo-po introduced the expenditure budget and work focus for the fiscal year 2024-25, stating that a variety of central bank digital currency cross-border networks (mBridge) are expected to be launched this year, with the first phase of services focusing on settling cross-border transactions for enterprises using various central bank digital currencies. In addition, the "digital renminbi" will also expand its pilot scope in Hong Kong, further improving cross-border payment efficiency and user experience. In terms of virtual assets, the government is promoting a series of measures to strengthen regulation and promote the stable and responsible development of the virtual asset market in Hong Kong. Specifically, the Hong Kong Monetary Authority launched a stablecoin sandbox in March this year, allowing institutions interested in issuing stablecoins to conduct testing within a controlled range. The government has also consulted the public on the regulation of fiat-backed stablecoin issuers and virtual asset over-the-counter trading services, and is considering the feedback received. Depending on the progress of preparatory work, the draft legislation will be submitted to the Legislative Council as soon as possible.

  • Three men and women arrested for laundering more than 1.8 billion yuan from virtual currency trading platforms and bank accounts

    Hong Kong Customs broke up a money laundering syndicate and arrested three local suspects who are suspected of using virtual currency trading platforms and multiple local bank accounts opened by companies to process over 1.8 billion yuan of funds with unknown sources. Customs officials targeted the three suspects based on intelligence and launched a wealth investigation, discovering that the three individuals conducted over 1,000 suspicious transactions between June 2021 and July 2022 through the opening of multiple local companies and bank accounts, including the transfer of funds from virtual currency trading platforms, involving more than 1.8 billion yuan.

  • BTC halving countdown only 1 day left

    According to Ouke Cloud Chain data, there is only 1 day and 17 hours left until the BTC halving countdown, which is expected to occur on 2024/04/20. The current block reward is 6.25 BTC, and after the halving, the block reward will be 3.125 BTC. There are currently 253 remaining blocks, the current network hashrate is 587.96 EH/s, the network mining difficulty is 83.95 T, and the average block time is 9.94 min.

  • Status Monkeys

    Analyzing NFTs as Social Networks Using the Status-as-a-Service Framework

  • It’s 2024 and there still aren’t enough blockchain developers.

    Why are there still up to ~1,000X less blockchain devs compared to other verticals like web development?

  • Art in the Age of Crypto Reproduction

    Aura, value, and politics in the age of crypto art

  • The total open interest of BTC options is $21.24 billion, and the open interest of ETH options is $9.42 billion.

    According to Coinglass data, the nominal value of open BTC option positions on the entire network is $21.24 billion, and the nominal value of open ETH option positions is $9.42 billion.

  • CZ launches testnet course on Giggle Academy

    CZ, the former CEO of Binance, announced the test network course of the recently launched education project Giggle Academy. CZ shared a video clip on his X account, which involved a course in an installable Android software package (Apk).

  • After the Bitcoin halving, new mining output will be reduced from 900 to 450 per day

    According to HODL15Capital's monitoring, after the halving of Bitcoin, its newly mined output will be reduced from 900 coins per day to 450 coins per day. Based on the current price, purchasing all of these new outputs would cost approximately $28 million.