Permit2 signature phishing Newbie method asset security risks need to be vigilant

robot
Abstract generation in progress

Unveiling the Uniswap Permit2 Signature Eyewash

Hackers are a terrifying presence in the Web3 ecosystem. For project teams, open source code makes them nervous, fearing that a single line of erroneous code may leave a vulnerability. For individual users, every on-chain interaction or signature could lead to asset theft. Therefore, security issues have always been one of the pain points in the crypto world. Due to the characteristics of blockchain, stolen assets are almost impossible to recover, so having security knowledge is particularly important.

Recently, a researcher discovered a new type of phishing technique that can lead to asset theft with just a signature. This method is extremely covert and difficult to prevent, and addresses that have interacted with certain trading platforms may be at risk. This article will popularize this signature phishing technique to minimize further asset losses.

Incident details

Recently, a friend ( Xiao A ) had his wallet assets stolen. Unlike common theft methods, Xiao A did not leak his private key nor interacted with phishing website contracts.

The blockchain explorer shows that the USDT in Wallet A was transferred using the Transfer From function. This means that another address operated to move the Token, rather than a leak of the wallet's private key.

Signed and then stolen? Unveiling the Uniswap Permit2 signature phishing eyewash

The transaction details reveal key clues:

  • An address transfers Xiao A's assets to another address.
  • This operation interacts with the Permit2 contract of a certain trading platform.

The problem is, how did this address obtain asset permissions? Why is it related to a certain trading platform?

To call the Transfer From function, the caller needs to have the Token allowance permission (approve). Before transferring little A's assets from that address, a Permit operation was also performed, and both operations interacted with a certain exchange's Permit2 contract.

Signature stolen? Exposing the Uniswap Permit2 signature phishing eyewash

Permit2 is a new contract launched by a trading platform at the end of 2022, allowing token authorization to be shared across different applications, aiming to create a more unified, cost-effective, and secure user experience. With more projects integrating, Permit2 is expected to achieve token approval standardization across all applications, reducing transaction costs and enhancing smart contract security.

The launch of Permit2 may change the rules of the Dapp ecosystem. Traditionally, users need to authorize each interaction with a Dapp, but Permit2 can eliminate this step, effectively reducing the interaction cost for users. As an intermediary between users and Dapps, users only need to authorize the Permit2 contract, and all Dapps integrated with this contract can share the authorized limit.

Signature stolen? Unveiling the Uniswap Permit2 signature phishing eyewash

However, this is also a double-edged sword. Permit2 turns user operations into off-chain signatures, with all on-chain operations completed by an intermediary. This means that even if the user's wallet does not have ETH, they can use other tokens to pay for gas fees or have the intermediary reimburse them. However, off-chain signatures are also the most easily overlooked aspect by users, as most people do not carefully check the content of the signature.

To use this phishing technique, the key prerequisite is that the phishing wallet must have authorized tokens to the Permit2 contract. Currently, any swap conducted on a Dapp or trading platform that integrates Permit2 requires authorization to the Permit2 contract.

The more frightening thing is that regardless of the Swap amount, the Permit2 contract will by default allow users to authorize the entire balance of that Token. Although the wallet will prompt for a custom input amount, most people may directly choose the maximum or default value, and the default value of Permit2 is unlimited.

Signature stolen? Unveiling the Uniswap Permit2 signature phishing eyewash

This means that as long as there has been interaction with a trading platform after 2023 and authorization given to the Permit2 contract, there may be a risk of this eyewash.

The key point is the Permit function, which allows the user to transfer the token limit authorized to the Permit2 contract to other addresses. As long as hackers obtain the user's signature, they can gain access to the token permissions in the user's wallet and transfer assets.

Detailed Analysis of the Incident

The Permit function allows users to pre-sign a "contract", permitting others (spender) to use a certain amount of tokens in the future. Users must provide a signature to prove the authenticity of the "contract".

Function workflow:

  1. Check if the current time exceeds the signature validity period
  2. Verify the authenticity of the signature
  3. If the inspection passes, update the record to allow others to use the tokens.

Signature stolen? Unveiling the Uniswap Permit2 signature phishing eyewash

The focus is on the verify function and the _updateApproval function.

The verify function retrieves the three data points v, r, and s from the signature information to recover the transaction signature address. The contract compares the recovered address with the provided token owner's address; if they are the same, the verification is successful.

Signature stolen? Uncovering the Uniswap Permit2 signature phishing eyewash

The _updateApproval function updates the authorization value after signature verification, meaning that the authority has been transferred. At this point, the authorized party can call the transferfrom function to transfer tokens to the specified address.

Is your signature being stolen? Unveiling the Uniswap Permit2 signature phishing eyewash

On-chain real transaction shows:

  • owner is the address of wallet A
  • Details include the authorized Token contract address and amount information.
  • Spender is the hacker address.
  • sigDeadline is the signature validity period, signature is Xiao A's signature information.

Signature stolen? Unveiling the Uniswap Permit2 signature phishing eyewash

Reviewing the interaction records of Xiao A, it was found that when using a certain trading platform, the default authorization limit was clicked, which is almost unlimited.

Signature stolen? Unveiling the Uniswap Permit2 signature phishing eyewash

Simple Review: Xiao A previously authorized an unlimited USDT quota to Permit2, and later accidentally fell into a phishing trap designed by hackers. After obtaining the signature, the hackers performed Permit and Transfer From operations in the Permit2 contract, transferring Xiao A's assets away. Currently, the Permit2 contract seems to have become a phishing paradise, and this phishing method has been active for about two months.

How to prevent it?

Considering that the Permit2 contract may become more widely adopted in the future, with more projects or integrations for authorization sharing, effective prevention measures include:

  1. Understand and identify the content of the signature: The Permit signature format typically includes key information such as Owner, Spender, value, nonce, and deadline. To enjoy the convenience of Permit2, it is essential to learn how to recognize this type of signature format. Using a security plugin is a good choice.

Signature stolen? Exposing the Uniswap Permit2 signature phishing eyewash

  1. Separation of asset wallet and interactive wallet: It is recommended to store a large amount of assets in a cold wallet, while keeping only a small amount of funds in the on-chain interactive wallet, which can significantly reduce losses when encountering eyewash.

  2. Limit authorization amount or revoke authorization: When swapping on a certain trading platform, only authorize the amount needed for interaction. Although requiring reauthorization for each interaction will increase costs, it can avoid the phishing risk associated with Permit2 signatures. Authorized users can cancel the authorization through a secure plugin.

Signature stolen? Exposing the Uniswap Permit2 signature phishing eyewash

  1. Identify the nature of the token and pay attention to whether it supports the permit function: In the future, more ERC20 tokens may realize the permit function. It is necessary to pay attention to whether the tokens held support it; if they do, trading operations must be extra cautious, and every unknown signature must be strictly checked.

  2. If you have tokens stored on other platforms after being scammed, you need to develop a comprehensive rescue plan: If you find that you have been deceived but still have tokens existing on other platforms through staking or other means, you need to be cautious when extracting and transferring. Hackers may monitor the address balance at any time, and once tokens appear, they may be transferred. A comprehensive rescue process should be established, and extraction and transfer should be executed simultaneously. MEV transfer can be used or professional security team assistance can be sought.

In the future, phishing based on Permit2 may increase, as this method is extremely covert and difficult to defend against. As the application scope of Permit2 expands, the number of exposed risk addresses will also increase. I hope readers can spread this article to more people after reading it, to prevent more people from suffering losses.

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 7
  • Share
Comment
0/400
InfraVibesvip
· 5h ago
Take a look before signing, got it?
View OriginalReply0
MetaverseMigrantvip
· 5h ago
Another new trick has been created. This Hacker is really talented.
View OriginalReply0
RektButAlivevip
· 5h ago
I am always following the latest vulnerabilities~
View OriginalReply0
StablecoinEnjoyervip
· 5h ago
New trap again, newbies be cautious when signing.
View OriginalReply0
NftBankruptcyClubvip
· 5h ago
How many fell into the trap again
View OriginalReply0
P2ENotWorkingvip
· 5h ago
Again, new suckers are being played for suckers.
View OriginalReply0
ValidatorVikingvip
· 5h ago
bloody hell, noobs never learn to verify signatures... back to basics ffs
Reply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)