PancakeSwap Hack
Incident Overview
Since April 12th, 2021 a person who had access to a Binance Smart Chain account 0x35f16a46…4095a1 (PancakeSwap admin account) has stolen from PancakeSwap lottery pool 59,765 Cakes (equivalent of about $1,800,000). He used the exploit a few times. Shortly after the last theft, the lottery game was suspended, and this account was banned by PancakeSwap.
The admin of PancakeSwap used his opportunity to manually call lottery contract methods such as:
- function drawing(uint256 _externalRandomNumber) external onlyAdmin
- function enterDrawingPhase() external onlyAdmin
He executed a few calls simultaneously (buy, enter drawing, draw) and put them all into the same block. That created for him an opportunity to predict jackpot numbers, since the random number generator, based on the previous block hash, was no longer random.
Incident Report
Protocol Information
What the Attacker Needed to Succeed
Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.
What Auditors Should Check
If you're auditing a protocol with similar architecture to PancakeSwap, these are the critical security checks that could have prevented this incident (April 2021).
- Verify all logic paths related to Other are guarded by proper access controls and input validation
- Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs
Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.
Free TrialSources & References
- 01
-
02
Source 2 https://hacked.slowmist.io/
Learn to Prevent the Next PancakeSwap
The PancakeSwap hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.