No way to part ways with project contractor #325
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
valid
Lines of code
https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Project.sol#L123
Vulnerability details
Impact
The function
Project.inviteContractor
adds a contractor to the project. Once a contractor is set andcontractorConfirmed
is set totrue
, thecontractor
address can not be changed anymore.If there are any real-world disputes between the project builder and the contractor, there is no way to part ways and define a new contractor. The project could then be stalled due to the
contractor
not signing multisig messages and griefing the system. Funds in the project contract could be locked as recovering thecurrency
tokens does not work due to tasks being unfinished.Proof of Concept
Project.sol#L123
Project.recoverTokens
Project.recoverTokens
reverts ifcurrency
tokens are to be rescued as long as the project has unfinished tasks. As a task can only be set as completed by callingProject.setComplete
, which in turn needs the message to be signed by the contractor, the contractor is able to grief the project.Tools Used
Manual review
Recommended mitigation steps
Consider implementing a function that allows resetting the current
contractor
and then allows inviting a new contractor.The text was updated successfully, but these errors were encountered: