The validate
function in the Swan contract allows validators to submit scores for task generations, which are later used in statistical calculations to determine task completion. However, there is currently no restriction on the score values submitted by validators, leaving the function susceptible to exploitation. Malicious validators could submit extremely high scores, either manipulating the final scoring to invalidate others' submissions or even causing a Denial-of-Service (DoS) by forcing a mean calculation overflow, thereby preventing task finalization.
This vulnerability arises from the absence of boundary checks for scores submitted in the validate
function. Without upper and lower limits on scores, a validator could submit a very high score, skewing the mean and standard deviation calculation. This could result in:
Bias in Final Scoring: A validator could force out other valid submissions by using high scores to shift the mean and standard deviation, effectively biasing the validation outcome in favor of their own submission.
Mean Calculation Overflow: Setting scores at maximum unit values could cause the mean calculation to overflow, particularly in the Statistics.avg
and Statistics.stddev
functions, which could prevent task completion as the scoring calculations fail to finalize.
Test:
Overflow in mean calculations could cause contract operations to revert, effectively creating a Denial-of-Service attack and preventing finalization of tasks.
Manual
Impose minimum and maximum thresholds for validator scores, ensuring that inputs remain within reasonable bounds and preventing extreme values from disrupting calculations.
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.