A vulnerability was identified in the GivingThanks::updateRegistry function of the smart contract. This function, which allows changing the address of the CharityRegistry, lacks an access control mechanism, allowing anyone to update the registry. This could enable a malicious actor to redirect funds to an arbitrary contract instead of the intended verified charities.
The GivingThanks::updateRegistry function lacks an access control check to ensure that only authorized personnel (e.g., an admin or owner) can modify the registry address. Without this restriction, any user can call GivingThanks::updateRegistry to set a malicious address for CharityRegistry, enabling redirection of funds to an unauthorized account.
The function should include a check to ensure that only the contract owner can modify the registry.
If exploited, this vulnerability could result in the redirection of funds intended for verified charities to an attacker-controlled address, resulting in significant financial loss.
Manual review of the smart contract code.
To mitigate this vulnerability, add an access control mechanism to the GivingThanks::updateRegistry function. This can be done by requiring that the caller is the contract owner, as demonstrated in the solution below:
Likelyhood: High, anyone can change it at anytime Impact: High, can bypass the verification process
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.