📢 Exclusive on Gate Square — #PROVE Creative Contest# is Now Live!
CandyDrop × Succinct (PROVE) — Trade to share 200,000 PROVE 👉 https://www.gate.com/announcements/article/46469
Futures Lucky Draw Challenge: Guaranteed 1 PROVE Airdrop per User 👉 https://www.gate.com/announcements/article/46491
🎁 Endless creativity · Rewards keep coming — Post to share 300 PROVE!
📅 Event PeriodAugust 12, 2025, 04:00 – August 17, 2025, 16:00 UTC
📌 How to Participate
1.Publish original content on Gate Square related to PROVE or the above activities (minimum 100 words; any format: analysis, tutorial, creativ
Analysis of Security Risks in NFT Contracts: Review of Events in the First Half of 2022 and Key Audit Points
NFT Contract Security Analysis: Review of Events in the First Half of 2022 and Discussion of Common Issues
In the first half of 2022, security incidents in the NFT sector occurred frequently, resulting in significant economic losses. According to statistics, there were a total of 10 major NFT security incidents in this half-year, with total losses reaching as high as $64.9 million. The main attack methods included exploiting contract vulnerabilities, private key leaks, and phishing. Notably, phishing attacks on the Discord platform were particularly rampant, with servers being attacked almost daily, causing numerous users to suffer losses due to clicking on malicious links.
Analysis of Typical Security Incidents
TreasureDAO event
On March 3rd, the TreasureDAO trading platform was attacked, and over 100 NFTs were stolen. The issue lies in the buyItem function of the TreasureMarketplaceBuyer contract. This function failed to check the token type when calculating the total price, directly multiplying the quantity by the unit price. This allowed attackers to call the buyItem function of the TreasureMarketplace contract to purchase tokens with an ERC-20 token payment amount of 0.
The root cause is the logical confusion caused by the mixed use of ERC-1155 and ERC-721 tokens. ERC-721 tokens themselves do not have a quantity concept, but the contract calculates the purchase price using quantity, and there is no logical separation in the final transfer implementation.
APE Coin airdrop event
On March 17, hackers obtained over 60,000 APE Coins through a flash loan airdrop. The problem lies in the AirdropGrapesToken airdrop contract. The contract uses alpha.balanceOf() and beta.balanceOf() to determine the caller's ownership of BAYC/MAYC NFTs, but this method only captures the instantaneous state of the user's NFT ownership, which can be manipulated through flash loans. The attackers exploited this vulnerability by borrowing BAYC NFTs via flash loans to claim the corresponding airdrop.
Revest Finance incident
On March 27, the Revest Finance project was attacked, resulting in a loss of approximately $120,000. This is a typical ERC-1155 reentrancy attack. The issue lies in the Revest contract. When users use depositAdditionalToFNFT() to add FNFT collateral assets, the contract needs to destroy the old FNFT first, and then mint a new FNFT. However, during the minting process, the min() function did not check whether the FNFT to be minted already existed, and the fnftId state variable increments after the _mint() function. Additionally, there is a hidden external call to ERC-1155's _doSafeTransferAcceptanceCheck() in the _min(), which creates a reentrancy vulnerability.
NBA wool pulling incident
On April 21, the NBA project encountered an attack. The issue lies in the signature verification mechanism of the The_Association_Sales contract. There are mainly two security vulnerabilities: signature spoofing and signature reuse. Signature reuse occurs because the contract does not store used signatures, allowing attackers to reuse the same signature multiple times. Signature spoofing happens because the vData memory parameter info is not validated for msg.sender during parameter passing, allowing the signature to be spoofed.
Akutar incident
On April 23, the AkuAuction contract of the NFT project Akutar was locked with 11,539 ETH (approximately 34 million USD) due to vulnerabilities. The contract has two logical flaws:
XCarnival event
On June 24, the NFT lending protocol XCarnival was attacked, with hackers profiting 3,087 Ethereum (approximately $3.8 million). The issue was with the pledgeAndBorrow function of the XNFT contract. This function did not check whether the xToken address provided by the attacker was in the project's whitelist when staking the NFT, and it did not verify the status of the collateral records during lending, allowing the attacker to repeatedly use invalid collateral records for borrowing.
Common Questions about NFT Contract Audits
Signature spoofing and reuse:
Logical Vulnerability:
ERC721/ERC1155 Reentrancy Attack:
The scope of authorization is too broad:
Price Manipulation:
Given the frequent security incidents related to NFT contracts, and the vulnerabilities discovered during the auditing process often aligning with actual attacks, it is particularly important to seek professional security companies to conduct a comprehensive audit of NFT contracts.