Breaking news

Prevent hacker phishing attacks: You must understand these three signature authorization principles | DongZuDongTun – the most influential blockchain news media

--

In the Web3 ecosystem, “signature phishing” incidents emerge one after another. In addition to staying vigilant, users can more effectively prevent being deceived if they understand the principles behind them.This article is originated from “Spinach Spinach”https://twitter.com/wzxznl/status/1781969154268098701organized, compiled and written by PANews.
(Recap:Notice! “Email phishing attacks” are rampant among creditors of FTX and BlockFi, and 7 million cryptocurrencies and NFTs have been stolen)
(Background supplement:The well-known foreign media Cointelegraph’s X is shockingly reported to have been hacked!Share multiple fancy fake airdrops and phishing addresses)

brightI just signed my name, why is my money gone? “Signature phishing” is currently becoming the favorite phishing method of Web3 hackers. Recently, I have seen that Mr. Cosine (the founder of SlowMist) and major wallets and security companies are constantly promoting the knowledge of popular phishing signatures, but every day there are still A lot of people were fished.

Spinach believes that one of the reasons is that most people do not understand the underlying logic of wallet interaction, and the learning threshold is too high for people who do not understand technology, so Spinach decided to create an illustrated version of the underlying logic of signature phishing and try to use it In the most vernacular form, people who are not technical can understand it.

How the wallet works

First of all, we need to know that we only have two operations when using the wallet: “sign” and”interactive”. The simplest and most direct understanding is that signatures occur outside the blockchain (off-chain) and do not require gas fees; interactions occur on the blockchain (on-chain) and require gas fees. of.

The general usage scenario of signature is to verify that you are you, such as logging into the wallet. Just like if you want to go to Uniswap to exchange tokens, you need to connect your wallet first. Then at this time you need to sign a name to tell the website “I am this “Wallet owner”, then you can use Uniswap. This step will not cause any data or status changes to the blockchain, so there is no need to spend money.

In terms of interaction, when you want to actually exchange Tokens on Uniswap, you need to spend a sum of money first to tell Uniswap’s smart contract: “I want to use 100USDT to exchange for a spinach coin, and I approve that you can move my 100USDT.” This The steps are calledAuthorize(approve), and then you have to spend another amount of money to tell Uniswap’s smart contract: “I want to exchange 100USDT for a spinach coin now, and you can do the operation now.” Then you have completed the exchange of 100USDT for a spinach coin. operation.

Principles and methods of fishing

After briefly understanding the difference between signature and interaction, we will introduce the principle of phishing. Spinach will list three different methods: authorization phishing, Permit signature phishing and Permit2 signature phishing. These three are very common phishing methods.

Authorized fishing

Let’s talk firstAuthorized fishingthis is one of the most classic phishing techniques in Web3 in the past. As the name suggests, it uses the authorization (approve) mechanism. The previous example of Uniswap tells us that authorization is to tell the smart contract “I approve you to move my tokens by how many xxx”, so hackers You can make a fake phishing website with a beautiful front end disguised as an NFT project. In the middle of the website is a beautiful big button “Receive your airdrop”. In fact, after you click it, the interface that pops up from your wallet actually lets you Authorize your Token to the hacker’s address, and if you click Confirm at this time, congratulations to the hacker for successfully completing a KPI.

However, there is a problem with authorized phishing: because it costs gas, many people are now wary of operations that involve spending money. After clicking on an unfamiliar website, you will find something wrong after a quick glance, so it is better to prevent it.

Permit signature phishing and Permit2 signature phishing

Then comes today’s protagonist: Permit and Permit2 signature phishing, which is the hardest hit area in the field of Web3 asset security. Why is it so difficult to prevent?

Because every time you want to use a DApp, you must sign in to your wallet. Many people may have formed an inertial thought in their minds: “This operation is safe.” In addition, it does not require spending money and most people Don’t know what each signature means.

Let’s look at it first Permit Mechanism, Permit is an extension suite function for authorization under the ERC-20 standard. The USDT we usually use is ERC-20. Simply put, you can sign to approve others to move your Token. We know authorization (Approve). You spend money to tell the smart contract: “You can move my xxx amount of Tokens.” Then Permit means you sign a “note” to a certain person. This paper says: “I allow so-and-so Someone can move my xxx number of Tokens”,

Then this person takes this “note” to the smart contract and spends a gas fee to tell the smart contract: “He allows me to move his xxx number of Tokens.” Then your money can be moved by others. In this process You just signed a name, but behind the scenes it means that you allow others to call authorization (Approve) and transfer your token. A hacker can make a phishing website and replace the button to log in to the wallet with Permit phishing, then You can easily fish away your assets.

So Permit2 What is it again? Permit2 is actually not a function of ERC-20, but a function launched by Uniswap for the convenience of users. The previous example said that if you want to use USDT to exchange spinach coins on Uniswap, you need to authorize (Approve) once before proceeding. Exchange requires two gas fees, so Uniswap came up with a way: “You authorize all the quota to me at once, and you sign your name every time you exchange and I will handle it for you.” This function helps Uniswap Users only need to pay the Gas fee once when using it, and this step is signing, so the Gas fee is not actually paid by you, but paid by the Permit2 contract, but it will be deducted from the Token you finally redeem.

However, the prerequisite for Permit2 phishing is that you have used Uniswap before, and you have also authorized unlimited quotas to the Permit2 smart contract. Since the current default operation of Uniswap is unlimited quota authorization, the number of users who meet this condition is actually quite large. , similarly hackers can transfer your Token away by tricking you into signing your name (only authorized).

in conclusion

To sum up, the essence of authorization phishing is that you spend a sum of money to tell the smart contract: “I approve you to misappropriate my Token to hackers.” The essence of signature phishing is that you sign a “note” that allows others to move your assets. Give it to the hacker, and the hacker spends money to tell the smart contract: “I want to misappropriate his Token and transfer it to me.” Permit and Permit2 are currently the hardest hit areas for phishing signatures. Permit is an authorized extension suite function of ERC-20, and Permit2 is a new function launched by Uniswap.

So once you understand the principle, how can you prevent it?

  1. The first and most important thing is to cultivate your security awareness. Every time you operate your wallet, you must check what exactly are you doing?
  2. Large funds are separated from wallets on the WanChain, so losses can be minimized once phished.
  3. Learn to identify the signature formats of Permit and Permit2. As long as you see the following signature formats, you should be alert: Interactive (interactive website), Owner (authorizing party address), Spender (authorized party address), Value (authorized quantity) ), Nonce (random number), Deadline (expiration time)

-

NEXT Binance Changpeng Zhao was finally sentenced to 4 months in prison. What did CZ say in court? | DongZuDongTren – the most influential blockchain news media