This repository has been archived by the owner on Dec 22, 2024. It is now read-only.
dany.armstrong90 - Attacker can inflate stake rewards as he wants. #146
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
dany.armstrong90
High
Attacker can inflate stake rewards as he wants.
Summary
FeeRewardsProcess.sol#updateAccountFeeRewards
function uses balance of account as amount of stake tokens.Since it is possible to transfer stake tokens to any accounts, attacker can flash loan other's stake tokens to inflate stake rewards.
Vulnerability Detail
FeeRewardsProcess.sol#updateAccountFeeRewards
function is the following.Balance of account is used as amount of stake tokens in
L63
.But since the stake tokens can be transferred to any other account, attacker can inflate stake token rewards by flash loan.
Example:
account1
,account2
.account1
and 1000 ETH inaccount2
.account2
toaccount1
and claim rewards foraccount1
.account1
.account2
too.Impact
Attacker can inflate stake rewards as he wants using this vulnerability.
Code Snippet
https://github.com/sherlock-audit/2024-05-elfi-protocol/blob/main/elfi-perp-contracts/contracts/process/FeeRewardsProcess.sol#L63
Tool used
Manual Review
Recommendation
Use
stakingAccount.stakeTokenBalances[stakeToken].stakeAmount
instead of stake token balance as follows.The text was updated successfully, but these errors were encountered: