The GivingThanks::updateRegistry function has no access control, meaning that the value of the GivingThanks::registry state variable can be modified to point to a malicious instance of the CharityRegistry contract.
As can be seen below the function GivingThanks::updateRegistry has no access controls and is public, meaning it can be called by anyone.
This allows an attacker to create a malicious instance of the CharityRegistry contract and change the value of GivingThanks::registry to point to this instance.
The GivingThanks contract using a malicious instance of the CharityRegistry would prevent users from donating to legitimate charities and only enable donations to addresses verified by the attacker.
The following test can be added to the existing test suite to verify this vulnerability.
As can be seen above, an attacker can point the GivingThanks contract to a malicious CharityRegistry where they have admin privileges. This prevents previously verified charities from receiving donations and enables the attacker's wallet to receive donations.
Manual review & foundry unit tests.
An Access control check for the GivingThanks::owner should be added to the GivingThanks:updateRegistry function.
This prevents unauthorised users from changing the instance of the CharityRegistry used by the GivingThanks contract.
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.