Open code423n4 opened 2 years ago
@LilYeti : In TroveManagerRedemptions, https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/TroveManagerRedemptions.sol#L311 WJLP.updateReward is called so this specific attack vector would not be possible, as the amount of reward that the borrower would be eligible for is updated to 0.
The attack vector is proven to be not possible, but the functionality is still incorrect as to spec, downgraded to low severity.
Handle
WatchPug
Vulnerability details
In the current design/implementation of
WJLP
and collateral redeem system, addingJLP
as collateral viaWJLP
can obtain rights to the future rewards.However, when the collaterals are redeemed (from other borrowers), the rights to future rewards are not revoked.
This can be exploited as an economic attack vector.
PoC
Given:
JLP
tokens wrapped asWJLP
and used as collateral;JLP
is the only whitelisted collateral.The attacker can do the following steps:
JLP
toWJLP
, theWJLP.userInfo[attacker]
is the amount of $1M worth ofJLP
;WJLP
received as collateral;redeemCollateral()
to redeem $1M worth ofJLP
with 1M YUSD;WJLP.userInfo[attacker]
is still the amount of $1M worth ofJLP
, and can continuously callWJLP.getPendingRewards()
to collect the rewards.The attack can be amplified with falshloan.