56761 bc insight the check for integer overflow in the function staker go checkstake is incorrect
Description
Details
func checkStake(valNextPeriodTVL, aggNextPeriodTVL, amount uint64) (uint64, error) {
total1, carry := bits.Add64(valNextPeriodTVL, aggNextPeriodTVL, 0)
//@audit no check carry
total2, carry := bits.Add64(total1, amount, carry)
if carry != 0 {
return 0, NewReverts("stake is out of range")
}
return total2, nil
}Impact
Recommendation
References
Proof of Concept
Previous56946 bc insight the code comparing two big in pointers for equality not their numeric valuesNext56657 bc insight inactive validator scheduling bypass in vechain thor pos consensus mechanism
Was this helpful?