Risk of Share Manipulation in LRTDepositPool Contract #99
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-42
edited-by-warden
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTDepositPool.sol#L109
https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L52-L79
Vulnerability details
Summary
The attack vector and impact is the same as TOB-YEARN-003, where users may not receive shares in exchange for their deposits if the total asset amount has been manipulated through a large “donation”.
Impact
The attacker can profit from future users' deposits. While the late users will lose their funds to the attacker.
POC
for simpility add the follownig code in LRTDepositPool.sol:
and modify getRsETHAmountToMint function to call above function instead of orcale.getRSETHPrice function:
the following test will show the vulnerability:
output:
Tools Used
Manual review
Recommendations
To address this vulnerability, several mitigation strategies can be implemented:
By implementing these measures, the contract can secure itself against share manipulation, ensuring a fair distribution of shares to all users.
Assessed type
Other
The text was updated successfully, but these errors were encountered: