Missing checks allow strategists to steal all fund via tailOff
#211
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
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/rubiconPools/BathPair.sol#L533-L563
https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/rubiconPools/BathToken.sol#L343-L369
Vulnerability details
Impact
Strategists can call
tailOff
with malicious payload to steal all funds within any BathToken.There are 2 issues that makes this possible:
BathPair.tailOff
allows arbitrary_stratUtil
address.BathToken.rebalance
allows underlying token asfilledAssetToRebalance
.These allow malicious strategists to input any token address, including the underlying token of a BathToken, and transfer them to a contract of their choosing.
Proof of Concept
A malicious strategist calls
tailOff
with the following payload:bathUSDC
BathToken will then send all USDC to the strategist'smaliciousContract
. All deposits are lost.Recommended Mitigation Steps
_stratUtil
.rebalance
to prevent transferring underlying token:The text was updated successfully, but these errors were encountered: