You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 13, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
The documentation for the protocol states that keepers are "trusted with vault yield but not user collateral. They generally perform upkeep on the vault such as swapping yield for Tau and running the LiquidationBot." However, they can abuse the SwapHandler.swapForTau() function to clean off the debt of every user of the protocol. With that, they can mint any amount of TAU they like and break the protocol.
Vulnerability Detail
swapForTau can only be called by the keepers. It uses an input argument _rewardProportion to determine the portion of swapped TAU used to repay the users debt via TauDripFeed._withholdTau(). A value of _rewardProportion = 1e18 means all the TAU swapped will be used to repay user debts.
However, there is no limit to the value provided by the keeper. Additionally, the accounting for reward is decorrelated to the actual balance of TAU received by the SwapHandler. As a result, the keeper can submit _rewardProportion = 1e70 (or any arbitrary value) to use 1e52 * amount of TAU received to repay debts, which should completely clean of all the debts in the vault.
Impact
Keeper has the power to break the protocol (clean off all the debt). They can open a position to withdraw as many TAU as they can, clean off their debts, and start again to mint as many TAU as they want.
Keeper has more power than the documentation claim they have.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
cducrest-brainbot
high
Keepers can clean off debts
Summary
The documentation for the protocol states that keepers are "trusted with vault yield but not user collateral. They generally perform upkeep on the vault such as swapping yield for Tau and running the LiquidationBot." However, they can abuse the
SwapHandler.swapForTau()
function to clean off the debt of every user of the protocol. With that, they can mint any amount of TAU they like and break the protocol.Vulnerability Detail
swapForTau
can only be called by the keepers. It uses an input argument_rewardProportion
to determine the portion of swapped TAU used to repay the users debt viaTauDripFeed._withholdTau()
. A value of_rewardProportion = 1e18
means all the TAU swapped will be used to repay user debts.However, there is no limit to the value provided by the keeper. Additionally, the accounting for reward is decorrelated to the actual balance of TAU received by the SwapHandler. As a result, the keeper can submit
_rewardProportion = 1e70
(or any arbitrary value) to use1e52 * amount of TAU received
to repay debts, which should completely clean of all the debts in the vault.Impact
Keeper has the power to break the protocol (clean off all the debt). They can open a position to withdraw as many TAU as they can, clean off their debts, and start again to mint as many TAU as they want.
Keeper has more power than the documentation claim they have.
Code Snippet
_rewardProportion
provided by keeper inswapForTau()
:https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/SwapHandler.sol#L45-L52
_withholdTau
called withtauReturned * _rewardProportion
:https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/SwapHandler.sol#L91
_withholdTau
increases tauWithheld, which is later used to repay user debts:https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/TauDripFeed.sol#L106-L110
Tool used
Manual Review
Recommendation
Limit the provided value of
_rewardProportion
by1e18
.Duplicate of #11
The text was updated successfully, but these errors were encountered: