The buyPass()
function in the Festival contract is vulnerable to reentrancy. The function calls _mint()
before updating the passSupply
state variable, and because it mints an token, it invokes onERC1155Received()
on the receiver. An attacker can use this hook to reenter buyPass()
and repeatedly mint passes before the supply is incremented, effectively bypassing the passSupply < maxSupply
check.
Risk :
HIGH :
no external condition needed to attack
Likelihood:
HIGH :
No reentrancy guard is used.
The vulnerable pattern (_mint()
before state update) is present.
Impact:
Attacker can buy multiple VIP passes in a single transaction, bypassing supply check.
Final passSupply
update only occurs after all reentrant calls.
Leaves only 1 pass unsold, denying others.
Move ++passSupply[collectionId];
before _mint()
to avoid reentrancy issues.
Alternatively, add a nonReentrant
modifier to buyPass()
using OpenZeppelin’s ReentrancyGuard
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.