The outlier gets the reduced payout when there is consensus on errors
The consensus check for errors in the Tally module incorrectly requires more than two-thirds of reveals to be errors, rather than at least two-thirds. As a result, when exactly two-thirds of reveals are errors, the code treats it as no consensus and reduces the payout for the outlier who reported no error, instead of paying the non-outliers fully.
Source: https://github.com/sherlock-audit/2024-12-seda-protocol-judging/issues/284
Found by
g
Summary
The payout for Executors is reduced when there is no consensus on the filter results. However, when 2/3 of the reveals are errors, it is not treated as consensus because of an error in the consensus check.
Root Cause
In filter.go:79, the consensus check for errors is incorrectly implemented. The errors must be greater than 2/3 of the reveals for a consensus with errors, which should not be the case.
// @audit the check must be `countErrors(res.errors)*3 >= len(reveals)*2`
case countErrors(res.Errors)*3 > len(reveals)*2:
Internal Pre-conditions
None
External Pre-conditions
None
Attack Path
- The Tally Module is processing a data request and executing its filter. It has 2/3 of the reveals as errors and has a
FilterModefilter. - When the FilterMode filter is applied, it returns a slice of outliers with the errors set as outliers and false on consensus.
- Since there is consensus on errors, this branch should be executed, and consensus should be set to true. Instead, the no-consensus branch runs.
- When the metering for executors is processed, the reduced payout is applied because of the
ErrConsensusInErrorerror.
Impact
The outlier who reported no error will receive a reduced payout. The intended behavior is for the non-outliers who reported the errors to receive the full payout.
PoC
None
Mitigation
Consider changing the check to case countErrors(res.Errors)*3 >= len(reveals)*2:
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/sedaprotocol/seda-chain/pull/524
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The consensus check uses a strict greater-than comparison instead of greater-than-or-equal, so exactly two-thirds of errors is not counted as consensus.
Impact
The outlier who reported no error receives a reduced payout, while the intended behaviour is for the non-outliers who reported errors to receive the full payout.
What the attacker needed
2/3 of reveals are errors; FilterMode filter is used
The fix
The check should be changed to use greater-than-or-equal instead of strict greater-than, and the protocol team fixed this issue in a pull request.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a blockchain-based data request system, multiple executors report results. If many report errors, the system should agree that errors are the consensus. A mistake in the comparison means that when exactly two-thirds report errors, the system does not recognise this as consensus, so it wrongly reduces the payout for the one executor who did not report an error.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.