Skip to content

StakingRewards.sol withdraw() allows withdrawal of locked stakes without proper balance tracking #12

@jasonhuan

Description

@jasonhuan

In StakingRewards.sol L242, the withdraw() function does not check how much a user's balance of LP tokens comes from the locked portion of stakes, and thus may allow a user to withdraw from their locked balance. When doing so, it subtracts the non-boosted amount from _boosted_balances instead of the boosted, locked amount, and thus allows for people to manipulate their balance in the StakingRewards contract.

This bug has been reported by @samczsun.

Link to bug:

_staking_token_boosted_supply = _staking_token_boosted_supply.sub(amount);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions