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` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
User cannot call the function that using burnFrom() for the TAU tokens
Summary
The function that uses burnFrom() to burn tokens can cause problems because it requires a certain allowance. In this case, the function will revert, preventing users from executing the function and breaking the logic.
The distributeTauRewards() function uses ERC20Burnable(tau).burnFrom(msg.sender, amount) to burn tokens from the msg.sender. However, the use of the burnFrom() function can result in serious issues.
In fact, many ERC20 tokens require that the allowance[from][msg.sender] >= amount in burnFrom() function. In this case, the call to the distributeTauRewards() function will revert as the allowance[TauDripFeed][TauDripFeed] == 0, and therefore users cannot deposit TAU to the contract. This can break the business logic.
Furthermore, the burnFrom() function has also been used in the _modifyPosition() function to repay debt and in the liquidate() function to liquidate an account for users and liquidators.
Impact
The user is unable to repay their TAU debt and deposit TAU into the contract.
The liquidator cannot use the liquidate() function to liquidate an account.
This can potentially disrupt the business logic.
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` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
LethL
high
User cannot call the function that using
burnFrom()
for the TAU tokensSummary
The function that uses
burnFrom()
to burn tokens can cause problems because it requires a certain allowance. In this case, the function will revert, preventing users from executing the function and breaking the logic.Reference: code-423n4/2022-03-joyn-findings#80
Vulnerability Detail
For example:
The
distributeTauRewards()
function usesERC20Burnable(tau).burnFrom(msg.sender, amount)
to burn tokens from themsg.sender
. However, the use of theburnFrom()
function can result in serious issues.In fact, many ERC20 tokens require that the
allowance[from][msg.sender] >= amount
inburnFrom()
function. In this case, the call to thedistributeTauRewards()
function will revert as theallowance[TauDripFeed][TauDripFeed] == 0
, and therefore users cannot deposit TAU to the contract. This can break the business logic.Furthermore, the
burnFrom()
function has also been used in the_modifyPosition()
function to repay debt and in theliquidate()
function to liquidate an account for users and liquidators.Impact
The user is unable to repay their TAU debt and deposit TAU into the contract.
The liquidator cannot use the
liquidate()
function to liquidate an account.This can potentially disrupt the business logic.
Code Snippet
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/BaseVault.sol#L300
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/BaseVault.sol#L376
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/Vault/TauDripFeed.sol#L53
Tool used
Manual Review
Recommendation
Replace
burnFrom()
function withburn()
function since all the addresses used as parameters inburnFrom()
function refer tomsg.sender
.Duplicate of #149
The text was updated successfully, but these errors were encountered: