BlockSec has discovered two major vulnerabilities in digital collectible contracts, locking up $34 million in funds.

The BlockSec team recently discovered two serious vulnerabilities in a certain digital collectible contract. These two vulnerabilities could lead to user assets being locked and the project party being unable to withdraw over $34 million in funds.

The first vulnerability involves the refund feature. The refund function in the contract uses a loop to refund all users, but if any of those users is a malicious contract, it may refuse to accept the refund and cause the entire transaction to fail. This would prevent all users from receiving their refunds. Fortunately, this vulnerability has not been exploited.

For projects that require refunds, it is recommended to take the following security measures:

  1. Participants are restricted to externally owned accounts (EOA) only.
  2. Use ERC20 tokens like WETH instead of native assets.
  3. Design a mechanism for users to actively claim refunds to avoid bulk refunds.

The second flaw is a code error. In the function for withdrawing project funds, there is a conditional judgment error. The function should compare the refund progress with the bid index, but it mistakenly compares it with the total number of bids. Since the refund progress is always less than the total number of bids and does not increase anymore, the condition can never be satisfied. This prevents the project party from withdrawing the funds locked in the contract.

These vulnerabilities once again highlight that even well-known projects can make fundamental mistakes. Development teams need to write comprehensive test cases and possess basic security awareness. While security audits have become a standard practice in the decentralized finance sector, they are still lacking in digital collectibles projects, and this incident has resulted in massive losses.

This event reminds us that even highly regarded projects can have serious vulnerabilities. It emphasizes the importance of conducting comprehensive security audits in blockchain project development, especially when handling large amounts of funds. The project party should place greater importance on contract security to prevent similar costly mistakes from occurring.

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
  • 6
  • Repost
  • Share
Comment
0/400
WalletDoomsDayvip
· 08-07 00:26
Refund, refund! Why is it another refund pit?
View OriginalReply0
WhaleMistakervip
· 08-06 16:59
In this day and age, it can still be written like this.
View OriginalReply0
QuorumVotervip
· 08-04 12:28
Fall the contract, who dares to rush money in?
View OriginalReply0
Ser_APY_2000vip
· 08-04 12:20
Thirty million dollars just got stuck like that? Oh my... that's really absurd.
View OriginalReply0
MidnightMEVeatervip
· 08-04 12:12
Locked again? This group of suckers deserves to be the leftover rice in the fridge.
View OriginalReply0
StakeTillRetirevip
· 08-04 12:05
It's really hard to get a refund for the IQ tax.
View OriginalReply0
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)