Root Cause: The updateRegistry function in the GivingThanks contract lacks access control modifiers, allowing anyone to change the registry address. Similarly, the registerCharity function in the CharityRegistry contract permits any user to register any address as a charity without any verification or restrictions.
Impact: Malicious actors can update the registry to point to a fraudulent contract or register unauthorized addresses as charities. This could lead to misdirection of donations, fraud, and loss of user trust.
updateRegistry Function in GivingThanks Contract:
Issue: No access control; any user can call this function.
Consequence: Attackers can redirect the registry to a malicious contract.
registerCharity Function in CharityRegistry Contract:
Issue: No restrictions on who can register a charity.
Consequence: Unauthorized or fraudulent addresses can be registered as charities.
Implement Access Control:
Use OpenZeppelin's Ownable contract to restrict access to sensitive functions.
Add the onlyOwner modifier to functions that should be restricted.
Add Proper Verification Mechanisms:
Introduce a process to verify charities before registration.
Ensure only trusted entities can register and verify charities.
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.