Atharv - No "0" value checking and duplicate `validatorId` in the function `BlockSpecimenProofChain.sol::addBSPOperator` for `validatorIDs` mapping #108
No "0" value checking and duplicate validatorId in the function BlockSpecimenProofChain.sol::addBSPOperator for validatorIDs mapping
Summary
No "0" value checking in the function BlockSpecimenProofChain.sol::addBSPOperator for validatorIDs mapping and we are assigning "0" value when removing in BlockSpecimenProofChain.sol::removeBSPOperator function.
Vulnerability Detail
While adding BSPOperator we should check the validatorId should not be equal to 0 otherwise, there is inconsistency in the smart contract and if the validatorId is already present we are overriding in the BlockSpecimenProofChain.sol::addBSPOperator function
Atharv
medium
No "0" value checking and duplicate
validatorId
in the functionBlockSpecimenProofChain.sol::addBSPOperator
forvalidatorIDs
mappingSummary
No "0" value checking in the function
BlockSpecimenProofChain.sol::addBSPOperator
forvalidatorIDs
mapping and we are assigning "0" value when removing inBlockSpecimenProofChain.sol::removeBSPOperator
function.Vulnerability Detail
While adding BSPOperator we should check the
validatorId
should not be equal to 0 otherwise, there is inconsistency in the smart contract and if thevalidatorId
is already present we are overriding in theBlockSpecimenProofChain.sol::addBSPOperator
functionImpact
Medium
Code Snippet
addBSPOperator
removeBSPOperator
Tool used
Manual Review
Recommendation