Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: Missing input sanitization in updateQuorumThresholdPercentage
The function updateQuorumThresholdPercentage() does not have any checks on the input parameter thresholdPercentage. The expected range of an uint8 value is 0 to 255, which means that the quorumThresholdPercentage value could theoretically be set to any value within this range. However, as this value is used as a percentage, acceptable values should be limited to the range 0 to 100.
If no checks are implemented, potential issues could occur. For instance, if the thresholdPercentage is set above 100, it might break the functions that use quorumThresholdPercentage as they might never reach the required quorum.
contracts/src/core/MachServiceManager.sol (Lines 147-150):
Valid ranges are 0-100 as implied by this comment on the individual threshold percentages:
contracts/src/core/MachServiceManager.sol (Lines 222-224):
It is recommended, to implement a sanity check to verify that the thresholdPercentage is within valid range (0 to 100). One could even further restrict the range for better security. If this condition is not met, the function should revert the operation.