The setParameters
function in the LLMOracleManager
contract lacks proper validation to ensure that the minimum and maximum task parameters follow logical bounds. Specifically, the contract allows setting minimumParameters
values higher than maximumParameters
, which can cause the onlyValidParameters
modifier to fail for all transactions. This flaw can disrupt the contract’s core functionality, effectively locking out user interactions or miscalculating parameters.
The setParameters
function allows the owner to update the bounds for parameters (e.g., difficulty, number of generations, number of validations) but lacks checks to ensure minimumParameters
values are lower than or equal to the maximumParameters
values. If minimumParameters
is set to a higher value than maximumParameters
, the onlyValidParameters
modifier will revert all calls that attempt to interact with the contract, as the range validation will fail. This vulnerability disrupts the service and impacts all users interacting with the contract.
The above code does not validate that minimums
values are less than or equal to maximums
values, leading to potential misconfiguration.
To demonstrate the vulnerability, we can create a test where the owner sets minimumParameters
to values that are greater than maximumParameters
, causing the onlyValidParameters
modifier to revert all parameter-based transactions.
The test should output a revert error for InvalidParameterRange
, confirming that the onlyValidParameters
modifier is failing due to misconfigured parameters.
This vulnerability can lock users out of interacting with the contract if the parameters are set incorrectly. As all user transactions will revert due to the onlyValidParameters
modifier, this could result in significant disruption to users and prevent the contract from functioning as intended.
Manual review.
To fix this issue, add validation checks in the setParameters
function to ensure minimums
are always less than or equal to maximums
:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.