Dria

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

Single Generator/Validator Setup Can Be Exploited to Game the System

Vulnerability Details

When numGenerations and numValidations are both set to 1 (which are the default values in scripts/common/parameters.ts and in the deployed contracts on Base Sepolia), a malicious actor with sufficient computational power can game the system by:

  1. Registering two addresses:

    • One as a Generator

    • One as a Validator

  2. For each oracle request:

    • The Generator address submits an invalid/low-quality response

    • The Validator address validates their own response with a high score

    • Both addresses collect their respective fees

LLMOracleCoordinator.sol#L334-L355

// compute the mean and standard deviation
(uint256 _stddev, uint256 _mean) = Statistics.stddev(scores);
// compute the score for this generation as the "inner-mean"
// and send rewards to validators that are within the range
uint256 innerSum = 0;
uint256 innerCount = 0;
for (uint256 v_i = 0; v_i < task.parameters.numValidations; ++v_i) {
uint256 score = scores[v_i];
if ((score >= _mean - _stddev) && (score <= _mean + _stddev)) {
innerSum += score;
innerCount++;
// send validation fee to the validator
_increaseAllowance(validations[taskId][v_i].validator, task.validatorFee);
}
}
// set score for this generation as the average of inner scores
uint256 inner_score = innerCount == 0 ? 0 : innerSum / innerCount;
responses[taskId][g_i].score = inner_score;
}

With only one validation:

  • The mean is equal to the single score

  • The standard deviation is 0

  • The single score will always be within range

  • The validator always gets paid

  • The generator always gets paid since there's only one response

Impact

  1. The oracle system can be completely gamed by a single actor

  2. Users receive low-quality or incorrect responses

  3. Malicious actors can collect both generator and validator fees while providing no value

  4. The protocol's reputation and utility are severely damaged

  5. This is particularly severe as these are the default parameters in parameters.ts and in the deployed testnet contracts

Recommendations

  1. Require a minimum of 3 validations per generation to ensure statistical significance

  2. Update the default parameters in parameters.ts to higher/safer values

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Appeal created

0xnbvc Submitter
about 1 year ago
inallhonesty Lead Judge
12 months ago
inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

There is no oracle whitelisting

Support

FAQs

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