Dria

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

Unfair Generation Of Response When No Validators

Summary

In the LLMOracleCoordinator::getBestResponse function, all results from a request are iterated to find the response with the highest score. This function is intended to select the best response based on scores assigned by validators. However, if there are no validators available for a given request, the function defaults to returning the first generated response. This introduces potential bias, as it fails to objectively determine the best response in the absence of validators.

Vulnerability Details

Consider a scenario where:

  1. A BuyerAgent initiates a request.

  2. Ten generators produce responses, and the request is considered complete.

  3. When the BuyerAgent calls getBestResponse, the function will return the first response by default, since no validators exist to evaluate and score the responses.

In this situation, the system fails to apply an unbiased selection process, potentially leading to unintended or suboptimal results for requests with zero validators.

Impact

This flaw can lead to biased and potentially inaccurate response selection for requests without validators. It could create an unfair advantage for responses generated first, regardless of quality. If exploited, malicious generators could submit low-quality responses early, knowing they would be selected in the absence of validation. This bias could erode trust in the system's reliability and quality, especially for critical requests.

Tools Used

Manual Review

Recommendations

To address this issue, implement the following mechanism to ensure fair selection when no validators are available:

  1. Randomized Selection in Absence of Validators: On the first invocation of getBestResponse for requests without validators, generate a random index to select one of the generated responses.

  2. Cache Random Index: Store the generated index to ensure consistency for subsequent calls to getBestResponse for the same request. This avoids re-selecting a different response upon each invocation and maintains stable results across repeated queries.

By implementing this approach, the function will avoid bias toward the first response and ensure fairer selection, even in validator-free scenarios.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Return value of `getBestResponse` when no validators

Support

FAQs

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