Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: low
Invalid

Uses the same revert message in different logical checks in the `LMOracleCoordinator::validate` function.

Relevant GitHub Links

https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/llm/LLMOracleCoordinator.sol#L275

https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/llm/LLMOracleCoordinator.sol#L282

Summary

Potential confusion due to error messages.

Vulnerability Details

In the LLMOracleCoordinator::validate function, the check for already responded validators uses the same revert message (AlreadyResponded) for both validation and generation participation:

function validate(uint256 taskId, uint256 nonce, uint256[] calldata scores, bytes calldata metadata)
public
onlyRegistered(LLMOracleKind.Validator)
onlyAtStatus(taskId, TaskStatus.PendingValidation)
{
/// ... The rest of code
// ensure validator did not participate in generation
for (uint256 i = 0; i < task.parameters.numGenerations; i++) {
if (responses[taskId][i].responder == msg.sender) {
@> revert AlreadyResponded(taskId, msg.sender);
}
}
// ensure validator to be unique for this task
for (uint256 i = 0; i < validations[taskId].length; i++) {
if (validations[taskId][i].validator == msg.sender) {
@> revert AlreadyResponded(taskId, msg.sender);
}
}
/// ... The rest of code
}

Impact

This could be confusing, as it might not be clear whether the revert was due to a validation participation or a generation participation.

Tools Used

Manual review.

Recommendations

Use separate revert messages for different conditions.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.