In CharityRegistry
contract isVerified
is checking the registeredCharities[charity]
instead of verifiedCharities[charity]
which allows attacker to register malicious contracts and mint NFTs basically for free.
In CharityRegistry
contract isVerified
is checking the registeredCharities[charity]
instead of verifiedCharities[charity]
which allow attacker to register malicious contract and mint NFTs basically for free.
The attacker creates a malicious contract, registers it as a charity address
Make a single donation
As the charity is a malicious contract that is calling the donation it receives the ether and calls the donation again
This way attacker can mint NFTs for free
Add an Attack contract in src
folder and paste the below code
Now paste this test in GivingThanks.t.sol
file and run the test
As you can see the test will pass.
Attacker can mint multiple NFTs for free with malicious contracts.
Manual review and foundry.
Change the isVerified function in CharityRegster contract
Likelyhood: High, the function returns registered charities instead of verified ones. Impact: High, Any charities can be registered by anyone and will be declared as verified by this function bypassing verification.
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.