The Adminable::transferAdmin
function lacks a validation check to prevent the admin address from being set to the zero address. This oversight can lead to a potential Denial of Service (DoS) attack, resulting in the loss of contract control
The Adminable::transferAdmin
function does not perform a check to ensure that the newAdmin
address is not zero before assigning it to the admin
variable. This vulnerability could allow an attacker to set the admin to the zero address, effectively locking them out of the contract.
An attacker could exploit this vulnerability by calling the transferAdmin
function with the zero address as the new admin. This would result in the admin
variable being set to the zero address, preventing any future calls to functions marked with the onlyAdmin
modifier from succeeding. This could lead to a loss of control over the contract and potentially lock up funds or functionality.
Manual code review
Static analysis: Slither, aderyn, cloc
Add a check to ensure that the newAdmin
address is not zero before assigning it to the admin variable. Here's an example of how to fix the code:
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.