This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
roguereddwarf - Missing input validation for _rewardProportion parameter allows keeper to escalate his privileges and pay back all loans #11
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
roguereddwarf
high
Missing input validation for _rewardProportion parameter allows keeper to escalate his privileges and pay back all loans
Summary
According to the Contest page and discussion with the sponsor, the role of a
keeper
is to perform liquidations and to swap yield token forTAU
using theSwapHandler.swapForTau
function:https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/SwapHandler.sol#L45-L52
They are also able to choose how much yield token to swap and what the proportion of the resulting TAU is that is distributed to users vs. not distributed in order to erase bad debt.
So a
keeper
is not trusted to perform any actions that go beyond swapping yield / performing liquidations.However there is a missing input validation for the
_rewardProportion
parameter in theSwapHandler.swapForTau
function.This allows a keeper to "erase" all debt of users.
So users can withdraw their collateral without paying any of the debt.
Vulnerability Detail
By looking at the code we can see that
_rewardProportion
is used to determine the amount ofTAU
that_withholdTau
is called with:Link
Any value of
_rewardProportion
greater than1e18
means that moreTAU
will be distributed to users than has been burnt (aka erasing debt).It is easy to see how the
keeper
can chose the number so big that_withholdTau
is called with a value close totype(uint256).max
which will certainly be enough to erase all debt.Impact
A
keeper
can escalate his privileges and erase all debt.This means that
TAU
will not be backed by any collateral anymore and will be worthless.Code Snippet
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/SwapHandler.sol#L45-L101
Tool used
Manual Review
Recommendation
I discussed this issue with the sponsor and it is intended that the
keeper
role can freely chose the value of the_rewardProportion
parameter within the[0,1e18]
range, i.e. 0%-100%.Therefore the fix is to simply check that
_rewardProportion
is not bigger than1e18
:The text was updated successfully, but these errors were encountered: