Category: Coding Mistakes
Invalid threshold can halt the protocol
Informational Severity
Informational Impact
N/A Likelihood
Description
The argument _newThreshold
for the function changeThreshold
must be less than or equal to the number of validators.
function changeThreshold(uint256 _newThreshold) external onlyOwner() {
threshold = _newThreshold;
emit ChangeThreshold(_newThreshold);
}
Impact
If the owner sets threshold
as a high value accidentally, the functions using the threshold
variable will be denied of service.
Recommendations
We recommend adding logic for the _newThreshold
.
Remediation
This issue has been acknowledged by Sotatek, and a fix was implemented in commit 17162c1a↗.