So as long as the status is still in Vouching a user is able to invoke this function.
Now lets proceed with the following scenario;
Alice (Honest user)
Bob (Malicious user)
Alice proposes a request and fully funds it herself
Alice wants to revoke her request for example; since she was unable to find sufficient vouchers, so decides to call withdrawRequest, this is still possible since the Status is still Vouching
Bob notices this and frontruns this call by calling AdvanceState
function advanceState(
address _claimer,
address[] calldata _vouches,
SignatureVouch[] calldata _signatureVouches
Bob will leave the _vouches & _signatureVouches array empty, note that the comment also reflects this possibility as stating it is optional as per this commentary:
// * @param _vouches Array of users whose vouches to count (optional).
// * @param _signatureVouches Array of EIP-712 signatures of struct IsHumanVoucher (optional).
AdvanceState will now execute the following lines of code:
It will skip the while loop, but will change the Status to Resolving
Ultimately Alice is robbed of her ability to withdraw her request.
this requires 0 to little effort and a bot could be created to repeat this process, the malicious user does not invest anything or risks anything by doing this
Recommendation
it might be more suitable to only allow a creator of a request to call advanceState or alternatively come up with some other logic
Github username: -- Twitter username: -- Submission hash (on-chain): 0x9359b2c7fd4c7b266a243ced3ce05c58bc6766c750f13e9ec78a9665531ab476 Severity: high
Description:
Report
a honest user can invoke
withdrawRequest
as long as the following requirements are true:So as long as the
status
is still inVouching
a user is able to invoke this function.Now lets proceed with the following scenario;
Alice (Honest user)
Bob (Malicious user)
Alice proposes a request and fully funds it herself
Alice wants to revoke her request for example; since she was unable to find sufficient vouchers, so decides to call
withdrawRequest
, this is still possible since theStatus
is stillVouching
Bob notices this and frontruns this call by calling
AdvanceState
Bob will leave the
_vouches
&_signatureVouches
array empty, note that the comment also reflects this possibility as stating it is optional as per this commentary:AdvanceState
will now execute the following lines of code:It will skip the
while
loop, but will change theStatus
toResolving
Ultimately Alice is robbed of her ability to withdraw her request.
this requires 0 to little effort and a bot could be created to repeat this process, the malicious user does not invest anything or risks anything by doing this
Recommendation
it might be more suitable to only allow a creator of a request to call
advanceState
or alternatively come up with some other logic