Open c4-bot-6 opened 11 months ago
hansfriese marked the issue as primary issue
fez-init (sponsor) confirmed
The impact is low because users might lose their funds by providing the wrong helper address. QA is more appropriate.
hansfriese changed the severity to QA (Quality Assurance)
hansfriese marked the issue as grade-a
Lines of code
https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/hook/MoneyMarketHook.sol#L53 https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/hook/MoneyMarketHook.sol#L257 https://github.com/code-423n4/2023-12-initcapital/blob/main/contracts/lending_pool/LendingPool.sol#L102
Vulnerability details
Impact
Users may have their funds stolen maliciously or by accident with a significant likelihood due to not using the correct rebase helper in the
MoneyMarketHook
.Proof of Concept
Function
execute()
does not validate the helper sent as argument.Here it transfers the funds directly to the helper.
Notice that the call would not revert as when depositing, no validation is performed against the actual deposited funds, it just deposits whatever is sent to the
LendingPool
. I can perform a POC if requested.Tools Used
Vscode, Foundry
Recommended Mitigation Steps
Create a mapping for the helper for each token instead of sending as argument.
Assessed type
Access Control