Closed sherlock-admin2 closed 4 months ago
1 comment(s) were left on this issue during the judging contest.
0xmystery commented:
Negative value in stake-specific functions causes
panic()
which permanently halts chain
The protocol team fixed this issue in the following PRs/commits: https://github.com/allora-network/allora-chain/pull/441
volodya
High
any user can halt chain with a negative amount request using RemoveStake
Summary
any user can halt chain with a negative amount request using RemoveStake
Vulnerability Detail
Any staker can call RemoveStake with a negative Amount variable, request will go through and when unstake will happen -> leads to a chain halt
x/emissions/keeper/msgserver/msg_server_stake.go#L61 EndBlocker -> RemoveStakes( NewCoin panics when there is negative values leading to a halt of blockchain
module/stake_removals.go#L35
types/coin.go#L27
Impact
Code Snippet
Tool used
Manual Review
Recommendation
Add validation
Duplicate of #21