XCarnival Hack
Incident Overview
XCarnival was attacked by a hacker for 3,087 $ETH of which 1,467 $ETH was returned to the creator address of the vulnerable contract.
The attacker created a contract, with the help of which it was just the same that managed to carry out the attack and pump out 3k $ETH from the victim's contract.
Contract creation transaction: https://etherscan.io/tx/0xe4f99b2f…206d09
The attacker called the pledgeAndBorrow() function, which creates an orderID and calls xToken.borrow. The function marks that the order has been borrowed. However, an attacker can control xToken, so an attacker can transfer an NFT with a fake xToken, and then borrow all the assets. When the attacker received $ETH, 2,967 was sent to another address where some of the tokens were withdrawn via Tornado.cash.
Transfer transaction to another address: https://etherscan.io/tx/0x7687857b…2a2f49
Half of the tokens were returned to the creator of the XCarnival contract in this transaction: https://etherscan.io/tx/0xcc3fda1e…ace701
As the time of this writing information on this case is scarce. More sources will be added if the case should develop.
Attack transaction where $3,087 $ETH was withdrawn: https://etherscan.io/tx/0x51cbfd46…e57e35
XCarnival Exploiter address: https://etherscan.io/address/0xb7cbb4d4…0b800a
Exploiter contract address: https://etherscan.io/address/0xf70f691d…9aca8d
Victim address: https://etherscan.io/address/0x39360ac1…fd9909
Example transactions of funds withdrawal via Tornado.cash:
1) https://etherscan.io/tx/0xf8eb760b…b21eb0
2) https://etherscan.io/tx/0xf6ffbc99…01ca87
3) https://etherscan.io/tx/0xd6be8d7f…668a0d
The transaction of the return of 1,467 $ETH to the XCarnival creator: https://etherscan.io/tx/0xcc3fda1e…ace701
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 XCarnival, these are the critical security checks that could have prevented this incident (June 2022).
- 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 TrialFunds Recovery
Recovered
$1.7M
Net Loss
2091224
Security Audit History
- Audit Report 1 Report
Sources & References
Learn to Prevent the Next XCarnival
The XCarnival 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.