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

  • ON–293: Yield

    Coverage on Convex Finance, Stake DAO, and Pendle

  • Comparing IBIT & CBOE to BTC Options on Deribit

    Since this week the crypto derivatives market offers various platforms for trading Bitcoin options, most notably the iShares Bitcoin Trust ETF (IBIT) options in the U.S. and the BTC options on Deribit and soon the ETF index options on CBOE.

  • U.S. Congressman Mike Flood: Looking forward to working with the next SEC Chairman to revoke the anti-crypto banking policy SAB 121

     US House of Representatives will investigate Representative Mike Flood's recent statement: "Despite widespread opposition, SAB 121 is still operating as a regulation, even though it has never gone through the normal Administrative Procedure Act process." Flood said, "I look forward to working with the next SEC chairman to revoke SAB 121. Whether Chairman Gary Gensler resigns on his own or President Trump fulfills his promise to dismiss Gensler, the new government has an excellent opportunity to usher in a new era after Gensler's departure." He added, "It's not surprising that Gensler opposed the digital asset regulatory framework passed by the House on a bipartisan basis earlier this year. 71 Democrats and House Republicans passed this common-sense framework together. Although the Democratic-led Senate rejected it, it represented a breakthrough moment for cryptocurrency and may provide information for the work of the unified Republican government when the next Congress begins in January next year."

  • Indian billionaire Adani summoned by US SEC to explain position on bribery case

    Indian billionaire Gautam Adani and his nephew, Sahil Adani, have been subpoenaed by the US Securities and Exchange Commission (SEC) to explain allegations of paying over $250 million in bribes to win solar power contracts. According to the Press Trust of India (PTI), the subpoena has been delivered to the Adani family's residence in Ahmedabad, a city in western India, and they have been given 21 days to respond. The notice, issued on November 21 by the Eastern District Court of New York, states that if the Adani family fails to respond on time, a default judgment will be made against them.

  • U.S. Congressman: SEC Commissioner Hester Peirce may become the new acting chairman of the SEC

    US Congressman French Hill revealed at the North American Blockchain Summit (NABS) that Republican SEC Commissioner Hester Peirce is "likely" to become the new acting chair of the US Securities and Exchange Commission (SEC). He noted that current chair Gary Gensler will step down on January 20, 2025, and the Republican Party will take over the SEC, with Peirce expected to succeed him.

  • Tether spokesperson: The relationship with Cantor is purely business, and the claim that Lutnick influenced regulatory actions is pure nonsense

     a spokesperson for Tether stated: "The relationship between Tether and Cantor Fitzgerald is purely a business relationship based on managing reserves. Claims that Howard Lutnick's joining the transition team in some way implies an influence on regulatory actions are baseless."

  • Bitwise CEO warns that ETHW is not suitable for all investors and has high risks and high volatility

    Hunter Horsley, CEO of Bitwise, posted on X platform that he was happy to see capital inflows into Bitwise's Ethereum exchange-traded fund ETHW, iShares, and Fidelity this Friday. He reminded that ETHW is not a registered investment company under the U.S. Investment Company Act of 1940 and therefore is not protected by the law. ETHW is not suitable for all investors due to its high risk and volatility.

  • Musk said he liked the "WOULD" meme, and the related tokens rose 400 times in a short period of time

    Musk posted a picture on his social media platform saying he likes the "WOULD" meme. As a result, the meme coin with the same name briefly surged. According to GMGN data, the meme coin with the same name created 123 days ago surged over 400 times in a short period of time, with a current market value of 4.5 million US dollars. Reminder to users: Meme coins have no practical use cases, prices are highly volatile, and investment should be cautious.

  • Victory Securities: Funding Rates halved and fell, Bitcoin's short-term direction is not one-sided

    Zhou Lele, the Vice Chief Operating Officer of Victory Securities, analyzed that the macro and high-level negative impact risks in the cryptocurrency market have passed. The risks are now more focused on expected realization, such as the American entrepreneur Musk and the American "Efficiency Department" (DOGE) led by Ramaswamy. After media reports, the increase in Dogecoin ($DOGE) was only 5.7%, while Dogecoin rose by 83% in the week when the US election results were announced. Last week, the net inflow of off-exchange Bitcoin ETF was US$1.67 billion, and the holdings of exchange contracts and CME contracts remained high, but the funding rates halved and fell back, indicating that the direction of Bitcoin in the short term is not one-sided, and bears are also accumulating strength.

  • ECB board member Villeroy: Falling inflation allows ECB to cut interest rates

     ECB board member Villeroy de Galhau said in an interview that the decline in inflation allows the ECB to lower interest rates. In addition, the slow pace of price increases compared to average wages is also a factor in the rate cut. Villeroy de Galhau emphasized that the ECB's interest rate policy decision is independent of the Fed. Evidence shows that the ECB began to lower interest rates in early June, while the Fed lowered interest rates three months later. With the decline in inflation, we will be able to continue to lower interest rates. Currently, the market generally expects the ECB to cut interest rates by 25 basis points at the next meeting in December, but weaker data increases the possibility of a 50 basis point cut.