Missing checks for address(0)
when assigning a new admin.
The Adminable::transferAdmin
function is intended to set the public Adminable::admin
to the newAdmin
, However it does not check if newAdmin
is the zero address.
Found in src/abstracts/Adminable.sol Line: 36
The zero address is not a valid user address in Ethereum. If the admin is set to the zero address, no one will be able to perform admin-only functions since no one can have the zero address as their address.
The below test shows how we can assign the zero address to be the new admin.
First we set up the contract.
We create our test.
We run our test in the terminal.
result.
Foundry, Aderyn
Add the following check to the Adminable::transferAdmin
function.
https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
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.