In burn(), the contract subtracts the amount of ALGO to send from the total_active_stake_key. The amount of ALGO can be bigger than total_active_stake_key causing an underflow.
Vulnerability Details
In burn() it subtracts the amount of ALGO that's sent to the user from total_active_stake_key:
total_active_stake_key is the sum of all the ALGO deposits made by users. When the user redeems their xALGO they get a little more ALGO back than they initially deposited because of the rewards earned by the proposers. That surplus amount of ALGO is not included in total_active_stake_key causing the total xALGO converted to ALGO to be bigger than total_active_stake_key which in turn will cause an underflow in certain situations.
algo_to_send is calculated as:
Here, algo_balance is the total ALGO balance of the proposers (deposits + rewards).
This only applies to very large depositors or the last users to redeem their xALGO.
Impact Details
A small subset of user funds will be frozen and not recoverable.