// line 965
token.transfer(admin, token.balanceOf(address(this)));
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
Start Balance for Victim: 10000 ETH.
Start Balance for Attacker: 10000 ETH.
End Balance for Victim: 9888 ETH.
End Balance for Attacker: 10111 ETH.
Victim Address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Attacker Address: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
NB: Deploy to Remix DEV Foundry (connects to cmd> anvil)
switch to first account (as alice) and deploy the victim contract.
switch to second account (as eve) and deploy the attack contract (at address).
switch to second account (as eve) and select 111 ETH and paste victim contract address for alice in input box next to button for attack and then click attack() button.
in account 2 for the attacker, eve, look at the log file and balance is ot +111 to 10111 ETH.
And the balance for alice, the victim is -111 including gas fee to 9888 ETH.
Lines of code
https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/src/core/Comptroller.sol#L965
Vulnerability details
Impact
Detailed description of the impact of this finding.
File
URL
Vulnerable lines of code
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
Log:
POC:
Tools Used
Recommended Mitigation Steps
Assessed type
Access Control