Cointime

Download App
iOS & Android

Staying Safe From DeFi Hacks: Learn Possible Vulnerabilities and Scam Attacks

Validated Project

The more a user knows about possible vulnerabilities or scam attacks, the safer their assets are.

While DeFi is constantly evolving and blockchain technology is becoming more secure, hackers still succeed in running fraudulent schemes and taking advantage of security vulnerabilities.

However, not every news report about another project suffering from a hacker attack should necessarily be frightening. In many cases, user funds remain safe or possible losses are offset by coverage, while on many occasions, hackers return stolen funds (partially or in full) after negotiations.

In any case, knowing about possible threats can help users to evaluate the risks of using a particular service to avoid losing funds.

Contract vulnerabilities

A developer’s failure to identify a bug often enables hackers to exploit a vulnerability and eventually withdraw user funds.

Over the past year, we have seen multiple attacks of that kind. For example, a programming flaw that appeared to be a fake minting bug was recently disclosed in the bridge between Optimism and BitBTC. Prompt vulnerability patching prevented extracting 200 bln tokens from Optimism since the flaw allowed for faking tokens on one side of the bridge and exchanging them for real ones.

In another case, the warning of a vulnerability in Opensea’s non-updated contracts prevented many users from losing their funds. The vulnerability facilitated withdrawing users’ NFTs after signing a malicious transaction.

The inability to properly validate the input of a transaction also causes multiple hacking issues, as it happened with Nomad bridge and Olympus DAO.

Exploitation of contract vulnerabilities comes in various ways, and a common strategy is based on reentrancy hacks occurring when a contract uses an outer call to interact with another contract whose former state isn’t yet updated. A hacker uses a specially built malicious smart contract to cause withdrawal from the target. Since the program flow is interrupted, the target’s smart contract is unable to update the attacker’s balance. One of the most significant reentrancy attacks ever is the Fei Protocol exploit that caused an $80 mln loss.

The first and primary countermeasure to prevent this type of attack or to disclose it before any damage has been done is to conduct audits.

Code should be audited regularly, and reports should be published to be available to the user. In the auditing process, security companies uncover bugs and simulate hacker attacks. Thus they help to ensure smart contract security and make transactions safe. So, before using any platform, it is worth checking its commitment to safety. This article thoroughly explaining the 1inch Network’s safety measures can help you to get a better idea of what security information should look like.

Flash loan attacks

Flash loans facilitate lending by enabling users to take a non-collateralized loan of any size from a liquidity pool under the condition that it will be repaid within a single transaction. Otherwise, a smart contract cancels the flash loan transaction and returns the funds to the lender.

Flash loans are often exploited by malicious actors to manipulate the borrowed asset’s price.

The Mango Markets trading platform was recently hit by an attacker who borrowed the MNGO token and pumped its price to use overpriced coins as collateral for borrowing BTC and other assets and withdrawing the profit. Hackers always know where to look for a weakness. For instance, New Free Dao’s contract calculating rewards was too simple, which caused a flash loan attack.

In the Crema Finance case, hackers created a fake price change data account to bypass contract checks and then used flash loans to drain the pool. The stolen finds were later partially returned thanks to a successful negotiation.

Meanwhile, other factors may also create an opportunity for attackers. Sometimes, an off-chain component causes a failure of price reporting even while on-chain price aggregation functions correctly.

Nefarious actors mainly target centralized price oracles, pulling data from a single exchange. Decentralized oracles, which focus on diversifying data collectors to the point where violating their quorum becomes too challenging, are therefore less vulnerable to that kind of manipulation.

Call the vulnerable function

Meanwhile, no matter how secure DeFi platforms may be, they are not immune to issues caused by a vulnerable third-party tool. Profanity, which offers vanity address generation and is quite popular among both users and platforms, turned out to be such a vulnerable tool. Earlier this year, 1inch contributors discovered a vulnerability in Profanity and immediately published a blog post and social media posts to warn the service’s users.

Such an event is almost impossible to prevent, but it is still possible to react quickly. Users can at least follow the social media accounts of the projects they interact with and monitor announcements of reputable market leaders. The Profanity case is quite typical, as, despite the 1inch warning, the vulnerability caused considerable losses, which timely reaction to the notification could have prevented.

Phishing attacks

One of the most common forms of attacks threatening all users is phishing. This cybercrime remains popular with hackers targeting all online services, not specifically DeFi platforms. Users of popular websites, platforms and projects can suffer from progressing phishing attacks.

Frequently, phishing attacks are performed through fake sites and applications of platforms/wallets that can imitate the interface of legitimate websites. However, the site’s domain name often helps to determine whether it is fraudulent. For example, the fake part may contain “com” rather than “io” etc. Essentially, the ultimate goal of phishing is to connect to the user’s device. So hackers trick users in different ways to make them connect their wallets or sign malicious transactions.

The good news is that this threat can be identified and prevented by users without any special knowledge or thorough research. All recent phishing attacks share the common trait of luring users to a fake website. In one case, Etherscan, CoinGecko and DeFi Pulse were attacked via malicious pop-ups offering users to connect their wallets to a phishing site that resembled the famous Bored Apes Yacht Club NFT project.

Another case involved airdropped tokens sent to addresses connected to Uniswap. Those tokens led users to a fraudulent site that encouraged them to sign malicious contracts enabling hackers to empty their wallets.

Phishing links are not necessarily automatically sent to users via emails or wallets. Even someone whom a user knows personally can send them. One of the frequently used methods is a ‘romance scam,’ whereby the victims’ trust is gained by a scammer in order to engage them in fake interest-earning schemes, usually persuading them to invest on suspicious platforms or websites resembling popular projects.

There are some strict rules to follow when interacting with websites, emails and wallets.

First, users should enter website names manually and download updates only via official platforms. Second, if users are taken to a website asking them to perform some action like connecting a wallet, entering a seed phrase or signing a contract, it’s a red flag.

Observe these rules, and stay safe!

Comments

All Comments

Recommended for you

  • ETH breaks through $3100

    the market shows ETH breaking through $3100, currently at $3100.29, with a 24-hour increase of 1.74%. The market is highly volatile, please manage your risks accordingly.

  • BTC breaks through $91,000

     the market shows BTC breaking through $91,000, currently at $91,011.99, with a 24-hour increase of 1.78%. The market is highly volatile, please manage your risk accordingly.

  • BTC breaks $90,000

    market shows BTC breaking through $90,000, currently at $90,009.99, the 24-hour decline narrowed to 0.57%, market volatility is high, please manage your risk properly.

  • The US spot Bitcoin ETF saw a net inflow of $54.8 million yesterday.

    according to data monitored by Farside Investors, the US spot Bitcoin ETF had a net inflow of 54.8 million USD yesterday.

  • The US spot Ethereum ETF saw a net outflow of $75.2 million yesterday.

     according to data monitored by Farside Investors, the US spot Ethereum ETF had a net outflow of 75.2 million USD yesterday.

  • Economists expect the Federal Reserve to cut interest rates in December, with two more cuts possible in 2026.

    according to economists surveyed, Federal Reserve officials are expected to vote next week to cut interest rates again to guard against the rising risk of a sharp deterioration in the labor market. The median of respondents shows that the Fed is expected to implement two more 25 basis point rate cuts within the year starting from March 2026. Next week's rate cut will continue the momentum of rate cuts from the policy meetings in September and October. A considerable majority also expect Fed officials to once again reiterate the statement that "the downside risks to employment have increased in recent months," as they did in October. The Federal Reserve will announce its decision at 2 PM Washington time on December 10, followed by a press conference held by Chairman Jerome Powell.

  • Bank of America: Markets will soon digest expectations of a Fed rate cut in January.

    Bank of America stated the market may soon price in the Federal Reserve's rate cut expectation in January. (Jin10)

  • He Lifeng held a video call with U.S. Treasury Secretary Bessant and Trade Representative Greer.

    He Lifeng, China's lead for China-US economic and trade relations and Vice Premier of the State Council, held a video call with the US leads, Treasury Secretary Janet Yellen and Trade Representative Katherine Tai. The two sides had in-depth and constructive exchanges on implementing the important consensus reached by the Chinese and US heads of state at the Busan meeting and the November 24 call, focusing on carrying out pragmatic cooperation and properly addressing mutual concerns in the economic and trade field. Both sides positively evaluated the implementation of the outcomes of the China-US economic and trade consultations in Kuala Lumpur, stating that under the strategic guidance of the two heads of state, they will continue to make good use of the China-US economic and trade consultation mechanism, continuously extend the cooperation list, reduce the list of issues, and promote the sustained, stable, and positive development of China-US economic and trade relations. 

  • Hassett: No discussion with US President Trump regarding the Federal Reserve Chair (selection)

    Director of the White House National Economic Council, Hassett, stated: He has not discussed the Federal Reserve Chair (candidate) issue with U.S. President Trump and supports Bassett's views on the Federal Reserve Chair. 

  • White House National Economic Council Director Hassett: It's Time for the Fed to Cautiously Cut Interest Rates

    White House National Economic Council Director Hassett stated: It is time for the Federal Reserve to cautiously cut interest rates.