In the cryptocurrency industry, security is often determined not only by the reliability of the blockchain itself but also by the quality of the underlying code. Sometimes a single flaw in a smart contract* can be enough for attackers to steal tens of millions of dollars, while confidence in a crypto project can be shattered within just a few hours.
* Smart contract — a piece of software deployed on a blockchain that automatically executes predefined conditions without the involvement of intermediaries. Essentially, it functions as a digital agreement: when a specified event occurs, the smart contract automatically performs an action, such as transferring cryptocurrency, distributing funds, recording a transaction, or granting access to a protocol feature.
This is precisely how a reentrancy attack works—one of the best-known and most dangerous vulnerabilities in the blockchain ecosystem. Although reentrancy attacks first gained widespread attention following the 2016 hack of The DAO, they continue to occur today and are becoming increasingly sophisticated and difficult to detect.
When a smart contract executes the same operation twice
Understanding the principle behind a reentrancy attack does not require programming knowledge.
Imagine an ATM that dispenses cash first and only then deducts the amount from your account balance. If there is even a slight delay between these two actions, an attacker could theoretically request another withdrawal before the balance has been updated.
As a result, the ATM would dispense more money than it should.
A similar situation can arise in smart contracts. If a contract transfers cryptocurrency to a user before updating its internal state, an attacker can repeatedly invoke the withdrawal function before the first transaction is completed. The contract treats each new request as legitimate and continues transferring funds.
As a result, the same operation is executed multiple times, even though it should have occurred only once.
Such vulnerabilities are common in blockchains that support smart contracts, including Ethereum, Solana, TRON, Toncoin, and other similar networks.
The hack that changed Ethereum's history
The most famous example of a reentrancy attack is the hack of The DAO.
In 2016, the project was widely regarded as the future of decentralized investing. It raised approximately $150 million in ETH, an unprecedented amount at the time. However, its success proved to be short-lived.
Attackers discovered a flaw in the smart contract's logic and exploited a reentrancy vulnerability to gradually drain its funds. The total losses amounted to approximately $70 million.
However, the financial damage was only part of the problem.
The incident triggered a major crisis within the Ethereum community. To return the stolen funds to investors, the developers made an unprecedented decision—to hard fork* the blockchain.
As a result, two separate networks emerged: the modern Ethereum and Ethereum Classic.
* Hard fork — a major protocol upgrade that is incompatible with the previous version of a blockchain. Following a hard fork, participants must upgrade their software; otherwise, they will continue operating under the old rules. If part of the community adopts the upgrade while another part remains on the previous version, the blockchain can split into two independent networks that share a common history up to the point of the split.
In effect, a single flaw in a smart contract changed the future of the entire Ethereum ecosystem.
Curve Finance: the problem wasn't the contract
Several years later, it became clear that even experienced development teams are not immune to such incidents.
The root cause was not the protocol itself but a flaw in certain versions of the Vyper programming language used to develop the smart contracts. Because of this bug, the language's built-in reentrancy protection did not function correctly.
Attackers quickly exploited the vulnerability and stole approximately $47 million worth of cryptocurrency.
According to Ancilia, more than 200 smart contracts were running vulnerable versions of Vyper. Once the issue was identified, developers had to urgently upgrade them to secure releases.
The incident once again demonstrated that security risks may originate not only from a project's own code but also from the tools developers rely on.
When the attack extends beyond a single blockchain
Modern reentrancy attacks have long since evolved beyond exploiting vulnerabilities within a single blockchain.
A notable example was the incident involving the Wintermute cross-chain bridge, which facilitated interactions between Ethereum and the OP Mainnet (formerly Optimism).
Cross-chain bridges are used to transfer crypto assets between different blockchains. Since blockchains cannot exchange data directly, these protocols verify a transfer on one network and then issue or unlock the corresponding assets on another.
The complexity of these mechanisms is often their greatest weakness.
In the case of Wintermute, attackers exploited the way cross-chain operations were processed, gained control of an address, and stole approximately 20 million OP tokens.
Incidents like this illustrate how significantly the architecture of modern blockchain projects has evolved. Whereas attackers once focused on exploiting a single function within one smart contract, they now search for vulnerabilities across entire chains of interactions involving multiple protocols.
Why reentrancy is considered one of the most dangerous attacks
According to analysts at Gate, various smart contract vulnerabilities resulted in losses exceeding $1 billion between 2016 and 2021 alone. A significant share of these incidents involved reentrancy attacks.
However, the damage extends far beyond the value of the stolen assets.
Following such attacks, projects often suffer severe reputational damage, users rapidly withdraw their funds, the value of native project tokens declines, and development teams are forced to implement emergency fixes and conduct additional security reviews.
At the same time, these high-profile exploits have driven the industry to develop stronger security practices.
One important development has been the widespread adoption of bug bounty programs.*
* Bug bounty program — a security initiative in which a project officially invites independent security researchers to examine its code, smart contracts, websites, or infrastructure for vulnerabilities. If a researcher discovers a flaw and responsibly discloses it to the project's team, they receive a financial reward. In the cryptocurrency industry, bug bounty programs are particularly valuable because they help identify critical vulnerabilities before malicious actors can exploit them. In many cases, they are also far less expensive than dealing with the consequences of a successful attack.
According to Immunefi, by 2025, bug bounty programs had become one of the most important tools for improving the security of blockchain projects.
How reentrancy attacks have evolved
During the era of The DAO, attackers only needed to find a vulnerability in a single smart contract function. Today, attack scenarios have become considerably more sophisticated.
Cybersecurity researchers distinguish several major types of reentrancy attacks.
Cross-contract reentrancy exploits interactions between multiple smart contracts.
Cross-function reentrancy relies on repeatedly invoking different functions within the same contract.
Cross-chain reentrancy targets operations spanning multiple blockchains and cross-chain bridges.
Finally, there is read-only reentrancy, in which an attacker does not directly modify a smart contract's state but instead manipulates a protocol's logic by exploiting temporarily inconsistent or outdated data.
As a result, modern security assessments are no longer limited to analyzing individual functions. Developers must model dozens of different interaction scenarios involving smart contracts, external services, and blockchain networks.
Is it possible to fully protect against reentrancy attacks?
Nevertheless, the risks can be significantly reduced.
Before using a new protocol, it is advisable to review the results of independent security audits and evaluate the project's overall security rating. For example, CertiK Skynet publishes information on smart contract audits and the current security status of many popular blockchain platforms.
For developers, it is essential to conduct comprehensive security audits regularly—not only of individual functions but also of the application's overall architecture, including interactions with external contracts and cross-chain bridges.
Users should also follow fundamental risk management principles. It is generally unwise to keep all of one's capital in a single protocol or liquidity pool. Even the largest DeFi (decentralized finance) projects cannot guarantee complete protection against software vulnerabilities.
Maintaining a well-diversified portfolio and relying on mature platforms with a long operational history can significantly reduce the likelihood of substantial losses in the event of a successful attack.