Cointime

Download App
iOS & Android

What Are the Common Security Issues in GameFi?

This article is a community submission. The author is Zhangchi Qin, a smart contract auditor at holistic blockchain security company Salus Security. 

Views in this article are of the contributor / author and do not necessarily reflect those of Binance Academy.

TLDR:

  • GameFi projects face various security challenges that can be classified as on-chain and off-chain issues. 
  • On-chain security challenges mainly involve the management of ERC-20 tokens and NFTs, the safety of cross-chain bridges, and decentralized autonomous organization (DAO) governance. 
  • Off-chain challenges, on the other hand, are typically related to web interfaces and servers. 
  • GameFi projects should prioritize security measures, such as rigorous audits, vulnerability scanning, and penetration testing, as well as implement best operational practices and business controls.

Introduction

GameFi combines blockchain technology with gaming to create decentralized platforms featuring in-game assets and digital currencies. It typically features a play-to-earn (P2E) model that allows players to earn crypto rewards. GameFi also gives gamers true ownership and complete control over their in-game assets.

While GameFi is gaining popularity, it’s facing continuous and significant threats from hacks throughout its life cycle. Some projects may value speed over quality and therefore, lack robust security precautions, putting both the community and creators at risk of significant losses.

Why Is GameFi Security Important?

GameFi experienced considerable growth in 2021 with its P2E model offering players novel in-game financial opportunities. In 2022, move-to-earn projects further highlighted GameFi’s growth potential. GameFi was crypto’s top sector in 2022, accounting for approximately 9.5% of the industry’s total funding and year-on-year growth of over 118%.

GameFi is different from traditional gaming because more is at stake for users and any hack could mean significant losses for them. In extreme scenarios, security breaches could end a project.

For example, attackers exploited a backdoor in a Remote Procedure Call (RPC) node to obtain a signature on the GameFi project Axie Infinity in 2022, allowing attackers to carry out unauthorized withdrawals totalling nearly $600 million in ETH. Any vulnerabilities in GameFi projects could result in massive losses for both investors and players, underscoring the critical importance of GameFi security.

On-chain Security Challenges

ERC-20 token vulnerabilities

ERC-20 tokens are frequently used in GameFi projects as a virtual currency for in-game purchases, reward mechanisms for players, and a means of exchange.

Improper minting and management of ERC-20 tokens can introduce security risks. One common vulnerability, called reentrancy, may arise during the minting process. Attacks can exploit the logic loophole in a contract to repeatedly execute a specific function, resulting in the infinite minting of tokens.

As universal in-game currencies, ERC-20 tokens’ stability and quantity determines a game’s playability and sustainability. Hence, projects should ensure the logic of codes and strictly control the total supply of ERC-20 tokens.

P2E GameFi project DeFi Kingdoms was attacked by malicious ERC-20 minting in 2022. Some players leveraged the logic vulnerability to mint the game’s locked native tokens, causing the token price to plummet afterwards.

NFT vulnerabilities

NFTs are primarily used as in-game virtual assets in GameFi projects, including equipment, props, and souvenirs. They offer players clear ownership and can maintain stable value via inflation control and scarcity. However, improper use of NFTs can introduce security vulnerabilities.

The value of NFTs is reflected in the rarity of equipment or props, with players typically seeking the rarest NFTs. During the NFT minting process, block-related information like timestamps may be used as a weak random source for generating NFTs with different levels of rarity.A miner can manipulate the block timestamp to some extent in order to maliciously mint rarer NFTs.

Even a reliable source of randomness, such as Chainlink VRF (Verifiable Random Function), does not remove all risks. Malicious users can revoke operations while minting unwanted NFT token IDs and repeat the process until a rare NFT is minted.

When players trade and transfer NFTs, potential smart contract vulnerabilities may occur. For example, the function safeTransferFrom() is used to transfer ERC-721 NFTs. When the receiver is a contract address, the function onERC721Received() will be triggered for a callback. Then there is the potential risk of the reentrancy attacks, whereby attackers can dictate the logic within the function on ERC721Received().

This risk also exists among ERC-1155 NFTs, whereby the function safeTransferFrom() triggers the function onERC1155Received() and allows attackers to carry out a reentrancy attack.

Bridge vulnerabilities

Cross-chain bridges are used in GameFi to allow users to exchange in-game assets across different networks. They are also critical for enhancing GameFi’s experiences and liquidity.

One major risk of cross-chain bridges in GameFi comes from inconsistencies among in-game assets. The contracts on both sides of the bridge should guarantee that the same amount of assets will be accepted and burned. However, due to loopholes in the contracts for verifying and accounting, attackers can compromise them to create a large number of assets out of thin air.

DAO governance vulnerabilities

Many GameFi projects are governed by DAOs, which may introduce the risk of centralization if the majority of governance tokens are owned by a few large actors. Smart contracts that define DAO governance rules open up another venue for potential compromises, as attackers can find ways to access the DAO treasury.

Off-chain Security Challenges

Most GameFi projects still depend on off-chain centralized servers for back-end operations, web interfaces, or mobile apps. These servers house critical information, including game data and owner accounts, and they are vulnerable to malicious attacks like penetration and Trojan horse malware.

When it comes to NFTs, metadata contains important descriptive information and is stored off-chain as JSON files. However, many GameFi projects store their NFT metadata on their own centralized servers instead of using decentralized infrastructure like IPFS. This increases the likelihood of metadata tampering by related parties or attackers, which could infringe on players’ rights.

In the context of cross-chain bridges, attackers may obtain validators’ signatures or private keys through penetration or phishing attacks. They can compromise the infrastructure and execute an exploit to control in-game assets.

During data transmission, attackers may hijack and inject the network packet with malicious code. By modifying the data package, attackers may implement false top-ups and use the unit purchase amount to get more game items.

Front-end interfaces give attackers another avenue to maliciously infiltrate the system. If an information leak occurs on the leaderboard of one game, attackers can send the leaked address-related information to the server to obtain corresponding sensitive information.

Ways To Improve Security

To safeguard GameFi projects, it’s crucial to exercise caution at every stage. Ensuring flawless smart contract codes is the foundation of a successful GameFi project — this involves writing high-quality code, conducting regular audits, and using formal smart contract verification.

Maintaining the security of servers and other infrastructure components is also critical; penetration testing should be conducted to detect possible vulnerabilities. With DApp- and blockchain-based systems, penetration testing brings with it Web3 features. As such, specific precautions are necessary for digital wallets and decentralized protocols.

GameFi projects should also adhere to other best practices, including a secure runtime process and complete emergency response. The former involves monitoring triggered security events, hardening environment security, and releasing bug bounty programs.

At the same time, projects must develop a complete emergency response process that includes aspects such as stop-loss disposal, attack tracking, and issue analysis.

Closing Thoughts

GameFi’s security vulnerabilities go beyond those mentioned in this article and many incidents have shown that projects have ignored or downplayed security risks. GameFi is a significant part of the future of gaming. As such, projects should always pay attention to security issues and put their communities’ interests first.

Read more: https://academy.binance.com/en/articles/what-are-the-common-security-issues-in-gamefi

NFT
Comments

All Comments

Recommended for you

  • Instagram Head Mosseri: Public Discontent with AI May Intensify in Coming Years

    Adam Mosseri, the head of Instagram, recently stated that public anxiety, frustration, and dissatisfaction with artificial intelligence are expected to intensify in the coming years. This sentiment affects not only young people and those in the creative industry but also workers in other fields. In an interview on the Colin and Samir podcast, Mosseri discussed the controversies surrounding AI. He pointed out that concerns about AI encompass various aspects, including the use of original content to train AI models, personal safety, and the potential for job displacement by AI. He believes that these worries are rooted in a broader fear of being left behind in the wave of AI advancements.

  • AI Storage Demand Squeezes Apple's Upgrade Profits: 1TB Flash Memory Cost Rises to $192, Gross Margin Drops to 68%

    The competition for flash memory supply in AI data centers is undermining Apple's long-standing ability to generate high profits from storage upgrades in iPhones. In the iPhone 17 Pro era, consumers need to pay an additional $200 to upgrade from the base capacity to 512GB, while Apple's estimated additional storage cost is only $15, resulting in a difference of $185. By the time of the iPhone 18 Pro, the additional cost rises to $66, and the difference decreases to $134. The changes for the 1TB version are even more pronounced: the additional storage cost has increased from $42 to $192, and Apple has raised the upgrade price from $400 to $600, resulting in a difference after deducting the additional storage cost that has increased from $358 to $408, but the gross margin has dropped from approximately 89.5% to 68%. The estimated storage cost for the new 2TB version is as high as $450. As AI companies purchase flash memory in large quantities and suppliers gain more bargaining power, Apple is passing on some of the costs by raising prices, but the high profit margins from storage upgrades have been eroded.

  • Walsh: Federal Reserve Meeting Schedule to Change Next Fall, No Rate Vote in 2027

    On October 29, Federal Reserve Chair Walsh stated that the schedule for the Federal Open Market Committee will begin to change next fall. In 2027, there will be one meeting that will neither conduct a rate vote nor issue a policy statement. It is expected that there will be two FOMC meetings in 2028 that will not conduct a rate vote.

  • BTC Surpasses $81,000

    Market data shows that BTC has surpassed $81,000, currently priced at $81,001.26, with a 24-hour increase of 0.54%. The market is highly volatile, so please ensure proper risk management.

  • Bank of Canada Raises Interest Rate by 25 Basis Points as Expected

    On October 28, the Bank of Canada raised its benchmark interest rate from 2.25% to 2.50%, marking the first rate hike in over three years and aligning with market expectations.

  • Tether Launches FASE Foundation with 11 Partners

    On October 28, Tether announced the establishment of the FASE (Financial Access and Systemic Empowerment Foundation) in Switzerland, a nonprofit multi-stakeholder foundation focused on four key pillars: financial security, financial freedom and inclusion, connectivity and clean energy, and access to end medical resources, as well as responsible AI and robotics. Founding stakeholders include Anchorage Digital, Bitfury, Bybit, Chainalysis, Fasanara Capital, Kraken, Opera, Pave Bank, Prosper Global (formerly Mercy Corps), Solana Foundation, and Tether, with technical consulting provided by the United Nations Office on Drugs and Crime (UNODC). The first three projects include: forming a global youth alliance with the social enterprise Goodwall to provide digital education and fraud prevention tools to up to 10 million young people in high-risk areas in Africa, Latin America, and Southeast Asia; piloting stablecoin humanitarian aid with Prosper Global, initially covering up to 1 million people as a template for future crisis response; and expanding cybercrime prevention networks in Africa, Asia, and Central America based on existing collaboration with UNODC, along with partnering with the United Nations Trust Fund for Victims of Trafficking to fund NGOs that assist survivors of human trafficking. Tether CEO Paolo Ardoino stated that the most vulnerable populations have long been overlooked by traditional financial systems. Prior to the official launch, the founding members held a meeting in Lugano, Switzerland, to establish strategic priorities.

  • Morgan Stanley Warns S&P 500 May Drop Another 8%

    On October 28, Mike Wilson, Chief U.S. Equity Strategist at Morgan Stanley, stated in a client report that a combination of AI financing pressures, the U.S. midterm elections on November 3, and tightening financial conditions could push the S&P 500 index down to around 7100 points in the coming weeks, representing a decline of about 8% from recent levels. This would mark the largest adjustment since the market turmoil triggered by the Iran war earlier this year. The firm noted that approximately 60% of the Russell 3000 index components have fallen over 20% from their peaks since early June, and about 96% of semiconductor stocks have also declined by more than 20%. They anticipate that the semiconductor sector may drop an additional 10% to 15% before mid-November. Credit spreads on bonds related to data centers have widened, with CoreWeave's debt entering distressed territory this month. The Federal Reserve raised interest rates to 3.75% to 4.00% in September, leading to rising bond yields. The firm maintains a year-end target of 8000 points for the S&P 500 and a fundamental target of 8300 points over the next 12 months, noting that markets typically perform better after midterm elections, with data from 1950 to 2022 showing an average increase of about 8% in the three months following elections.

  • Israeli Parliamentary Election Vote Counting Completed, Netanyahu's Camp Currently Leads

    On the 28th local time, according to Israeli sources, the vote counting for this round of Israeli parliamentary elections has been completed. The Likud party, led by current Prime Minister Netanyahu, remains in the lead with the highest percentage of valid votes counted so far. The Likud party continues to be the largest party in the parliament. However, there is a deadlock in the allocation of seats between Netanyahu's right-wing camp and the opposition camp led by Esenkot, with no single camp able to directly reach the majority of seats required to form a government.

  • Anthropic IPO Filing Warns of Risks from Trump Administration Retaliation

    On October 28, Bloomberg reported that in its IPO filing, Anthropic warned that its public advocacy for AI safety regulation and statements from executives could expose the company to risks such as government pressure and selective scrutiny. The document stated that even if other similarly situated companies are not treated equally, Anthropic could still become a target for specific government agencies, a risk associated with the company's multiple conflicts with the Trump administration: one stemming from disputes over the requirement for the U.S. Department of Defense to set safety limits when using its AI technology, and another related to disagreements over the safety and export controls of the Mythos model. The filing also indicated that future government interventions, export restrictions, and cybersecurity or biosafety incidents triggered by AI models could affect its product deployment, international expansion, and business growth. Furthermore, if the regulatory measures advocated by the company are implemented, compliance costs would rise, product development and release would be restricted, and its growth could slow down. Anthropic publicly submitted its S-1 filing on October 26, intending to list on Nasdaq under the ticker ANT.

  • AI Simulation System Sim Fed Previews October Rate Meeting: Seven Votes, Five for Pause

    On October 28, ahead of the Federal Reserve's upcoming interest rate decision, an AI simulation decision-making system called Sim Fed completed seven simulated votes: five opted to maintain the current interest rate, while two supported a rate hike, aligning closely with the market's mainstream expectation of a pause this week. The system was developed by Tara Sinclair, chair of the economics department at George Washington University, and Sophia Kazinnik, a research scientist at Stanford University's Digital Economy Lab. The two invested approximately a year and a half into the project, with a preliminary research paper set to be published by the end of 2025. Researchers clarified that the aforementioned votes are results of a simulation experiment and do not reflect the Federal Reserve's actual decisions; the real monetary policy decision is expected to be announced at 2 AM Beijing time on October 29.