On 25 January 2025, an attacker exploited a vulnerability in XPEPE’s TokenStaker contract which led to a 99% drop of the token price. The root cause was due to an un-revoked spend allowance when withdrawing staked tokens enabling the attacker to use the transferFrom() method to gain 100% extra tokens after each withdrawal from staking.
Exploit Transaction: https://etherscan.io/tx/0xbdec39a74e620fc624f90483aff067b17044f81138e6c30038daf7f873159db4
Addresses
Attack wallet: 0x269ff4d056252A30CAd249a4CD75cb9Bcfb1F46c
Attack contract: 0x64dc84faa300B5f27c7eBaE8D867d039337e5999
Vulnerable contract: 0x444156f2440D4CD7Ab84b4D0679476c6BDc61423
Step by Step
In the withdrawAll() function, tokens were approved to a user which allows them to retrieve their stake and rewards. The approval should have then been revoked once the user has claimed their tokens. The contract did contain a _spendAllowance() function which is used to update a user’s spend allowance but it was only called during transferFrom() and not the withdrawAll() function.
The attacker’s wallet, 0x269ff4d056252A30CAd249a4CD75cb9Bcfb1F46c, was funded on 4 January 2025 via Tornado Cash on the Binance Smart Chain (BSC), 0.2 ETH was later bridged to Ethereum via Orbiter Bridge on 22 January.
Analysis of 0x269 shows that is also linked to several incidents:
On 2 February 2025, the attacker transferred 12ETH to Tornado Cash.
In 2024, exploits related to code vulnerabilities accounted for a total loss of ~$173M with an average loss of $795,080 per incident, highlighting the risks of deploying unaudited code.
To keep up to date on the latest incident alerts and statistics follow @certikalert on X, or read our latest analysis on certik.com.