Anyone can create disputes if contractor
is not set
#327
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
valid
Lines of code
https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Project.sol#L498-L502
https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/libraries/SignatureDecoder.sol#L25
Vulnerability details
Impact
Disputes enable an actor to arbitrate & potentially enforce requested state changes. However, the current implementation does not properly implement authorization, thus anyone is able to create disputes and spam the system with invalid disputes.
Proof of Concept
Calling the
Project.raiseDispute
function with an invalid_signature
, for instance providing a_signature
with a length of 66 will returnaddress(0)
as the recovered signer address.Project.raiseDispute
SignatureDecoder.sol#L25
If
_task
is set to0
and the project does not have acontractor
, therequire
checks will pass andIDisputes(disputes).raiseDispute(_data, _signature);
is called. The same applies if a specific_task
is given and if the task has asubcontractor
. Then the check will also pass.Project.raiseDispute
Tools Used
Manual review
Recommended mitigation steps
Consider checking the recovered
signer
address inProject.raiseDispute
to not equal the zero-address:The text was updated successfully, but these errors were encountered: