The depositEgg()
function lacks access control, allowing anyone to call it, even if they did not transfer the NFT. This can lead to unauthorized deposits.
The depositEgg()
function is public and does not restrict access to only the intended caller (e.g., the EggHuntGame
contract). This allows any address to call the function and deposit an NFT.
An attacker can front-run a legitimate deposit by calling depositEgg()
with the same tokenId
, causing them to falsely claim credit for the deposit and potentially steal NFTs.
Solidity
Access Control Vulnerability Detection
Restrict access to the depositEgg()
function, allowing only the EggHuntGame
contract to call it:
This ensures that only the authorized EggHuntGame
contract can invoke the depositEgg()
function, mitigating the exploit.
Front-running depositEgg allows deposit ownership hijacking.
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.