Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: high
Invalid

Lack Access Control repay callable by anyone

Summary

repay is a public function that can be called by anyone

Vulnerability Details

function repay(IERC20 token, uint256 amount) public {
if (!s_currentlyFlashLoaning[token]) {
revert ThunderLoan__NotCurrentlyFlashLoaning();
}
AssetToken assetToken = s_tokenToAssetToken[IERC20(token)];
token.safeTransferFrom(msg.sender, address(assetToken), amount);
}

Can repay any chosen token to msg.sender

Impact

repay can be used to steal any amount of underlying tokens from the protocol

Tools Used

Manual Analysis

Recommendations

Make the function onlyOwner or relevant access control
Or remove the function as it seems for current working of protocol its not needed

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.