Open hats-bug-reporter[bot] opened 2 months ago
I’d like to highlight another point regarding this issue. Since the last round is not fully funded, a malicious user can retrieve their appealCost
by using the withdrawFeesAndRewards
function.
"None" (the ruling given in case of a tie) is never a correct ruling on PoH. So people do need to appeal and if a side doesn't it will lose. They need to do so before the deadline. As per the context rules are excluded: Issues about missing appeals (for the purpose of this review, we will assume that there is always a user providing appeal deposits in the case of a wrong provisional ruling).
Github username: -- Twitter username: -- Submission hash (on-chain): 0x006c1f839f986e592c808c7cca4369786d23d2b436c3550177b7bf00710fdc79 Severity: high
Description: Description:
A malicious user can manipulate the outcome in the event of a tie.
According to the protocol's rules, in the case of a tie, the registry should remain unchanged. However, a malicious user can exploit this by calling the
fundAppeal
function just before the appeal period ends, selecting their preferred winner. This action prevents any legitimate user from funding an appeal during the appeal period, effectively blocking them from submitting an appeal even if they wish to do so.There are two scenarios where this can occur:
A challenge is made against a request. If the voting results in a tie, a malicious user calls the
fundAppeal
function right before the appeal period ends.An appeal is filed against a challenge. If the voting results in a tie, a malicious user calls the
fundAppeal
function right before the appeal period ends.In both scenarios, the malicious user calls the
fundAppeal
function during a new round.This happens because a new round begins after a challenge or appeal is initiated:
As a result, the
round.sideFunded
variable for the new round is set toParty.None
by default.Since the malicious user only funds one side, the appeal is not created, and the
round.sideFunded
variable is set to reflect the side chosen by the malicious user:After the malicious user's action, no further appeals can be submitted, and no user can call
fundAppeal
once the appeal period has expired. This means that the outcome of the last round is determined by the malicious user's action.When the arbitrator calls the
rule
function, the winner of the dispute will always be the side chosen by the last user who calledfundAppeal
when appeal is not filed:Attack Scenario
round.sideFunded
variable is set toParty.None
.fundAppeal
function, funding only his preferred side (e.g.,Party.Requester
orParty.Challenger
).fundAppeal
, the outcome of the dispute is effectively determined by the malicious user's action.rule
function, the winner is determined by theround.sideFunded
value set by Bob, irrespective of the tie in voting.Solution: Adjust the
fundAppeal
function to reduce the time allowed for users to call it in the event of a tie to half the original period. This will prevent malicious users from exploiting the timing to manipulate the outcome. Add the following code in thefundAppeal
Function: