Submitted by jessicapointing
An inactive KNOT can successfully stake.
Expected behaviour of the system: The stake function should revert if an inactive KNOT is trying to stake.
Actual behaviour of the system: The stake function succeeds and the inactive KNOT stakes.
Property Violated: cannotStakeIfKnotIsInActive
In this rule, the isActive state of the blsPubKey is set to false. The stake function is then called with this blsPubKey and the expected behaviour is that the function would revert because the KNOT is inactive. However, the stake function succeeds and an inactive KNOT can therefore successfully stake. The stake function checks if KNOT is not registered (!isKNOTRegistered) and if it is no longer part of the syndicate (!isNoLongerPartOfSyndicate) and reverts accordingly but does not check whether the KNOT is inactive.
Lines of code: https://github.com/Certora/2023-01-blockswap-fv/blob/certora/contracts/syndicate/Syndicate.sol#L216
jessicapointing (warden) commented:
The principle found here can be applied to other functions in the code which reveal potentially more bugs. In other words, just as I have pointed out here that an inActive KNOT can successfully call stake and succeed, an inActive KNOT (or !isKnotRegistered or isNoLongerPartOfSyndicate KNOT) can successfully call other functions it shouldnt be able to and succeed. To fix these bugs, check the isActive/isKnotRegistered/isNoLongerPartOfSyndicate state of a KNOT before executing the function. Maybe the lack of checks are intentional because inactive/deregistered knots can still call some functions but Im including them here for completeness and in case they shouldnt be able to execute such functions. Here are some of the other functions and lines of code:
unstake:
isActive and isKnotRegistered is not checked.
claimAsCollateralizedSLOTOwner:
isActive and isNoLongerPartOfSyndicate is not checked.
_updateCollateralizedSlotOwnersLiabilitySnapshot:
isActive and isKnotRegistered is not checked.
_claimAsStaker:
isActive and isNoLongerPartOfSyndicate is not checked.
vince0656 (Blockswap) commented:
teryanarmen (Certora) commented:
