In tailOff() of BathPiar users funds will be lost if strategist call function with wrong parameters #247
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/rubiconPools/BathPair.sol#L533-L563
Vulnerability details
Impact
Function
tailOff()
is callable by strategist and it sendsBathToken
funds to_stratUtil
address. There is no whitelist check for the destination address and if strategist by mistake or intentionally calltailOff()
by wrong values liquidity providers funds will be lost.Proof of Concept
This is
tailOff()
code inBathPair
:As you can see it calls
rebalance()
oftargetPool
and it will sendamount
underlying token to_stratUtil
address. if strategist set_stratUtil
value wrongly then users funds will be lost forever.There should be some whitelist for
_stratUtil
that strategist can only send funds to them, is not secure to totally deponed on strategists not making mistake or not doing anything wrong.Tools Used
VIM
Recommended Mitigation Steps
add
_stratUtil
addresses list inBathPair
and confirm them.The text was updated successfully, but these errors were encountered: