Closed c4-bot-10 closed 9 months ago
Picodes marked the issue as unsatisfactory: Invalid
I'm pretty sure this is a high serious bug, The key questions are: Users can retrieve their collateral using public methods in the parent class, This means that users can obtain usds without collateral.
Hope to check again.
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L83 https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/Liquidity.sol#L157
Vulnerability details
Impact
Borrow USDS without having to repay it.
Proof of Concept
The
CollateralAndLiquidity
determines the amount of usds that can be lent based on the number ofUserShareForpools
.Users use
depositCollateralAndIncreaseShare
increaseuserShare
,withdrawCollateralAndClaim
reduceuserShare
.withdrawCollateralAndClaim
, depending on the amount of usds lending decisions can withdraw the number of theuserShare
.The problem is that the
CollateralAndLiquidity
contract inheritsLiquidity
, which is available in thecollateralandLiquidity
contract via another public function, withdrawCollateral:Therefore, a malicious user can use Liquidity#withdrawLiquidityAndClaim to retrieve his collateral, so that he wouldn't have to pay any debts.
Tools Used
vscode, manual
Recommended Mitigation Steps
CollateralAndLiquidity
contracts forwithdrawLiquidityAndClaim
function increase the access control.Assessed type
Error