Description:
The depositEgg(uint256 tokenId, address depositor) function in the EggVault contract lacks access control, allowing any user to call it and deposit eggs on behalf of others. This could lead to unauthorized deposits, potentially causing confusion or misuse of the contract. If this isnt intended you should restrict access.
Impact:
Unauthorized users could manipulate the state of the contract by depositing eggs without proper permissions, leading to potential misuse or unexpected behavior.
Proof of Concept:
Recommended Mitigation:
Restrict access to the depositEgg function by adding appropriate access control modifiers, such as onlyContract or a custom role-based modifier. For example:
Alternatively, implement a role-based access control mechanism using OpenZeppelin's AccessControl library to allow specific roles to call this function.
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.