This repository has been archived by the owner on May 26, 2023. It is now read-only.
HonorLt - Wrong indication of ongoing invoice and supported documents complete #460
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Non-Reward
This issue will not receive a payout
HonorLt
medium
Wrong indication of ongoing invoice and supported documents complete
Summary
Ongoing bounty
setInvoiceComplete
andsetSupportingDocumentsComplete
do not respect the decoded bool value.Vulnerability Detail
setInvoiceComplete
andsetSupportingDocumentsComplete
always push to the respective array, no matter if the boolean flag is true or false:These arrays are then exposed over getters:
These results will be included in the getters array no matter if the boolean value was true or false.
Impact
Functions that rely on these values, can misbehave by treating the data as correct when the actual flag was false.
Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/OngoingBountyV1.sol#L182
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/OngoingBountyV1.sol#L197
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/OngoingBountyV1.sol#L205-L211
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/OngoingBountyV1.sol#L218-L220
Tool used
Manual Review
Recommendation
Only push to the array if the flag is true. If the flag is false, and the entry was present in the array, then should probably remove it.
Duplicate of #425
The text was updated successfully, but these errors were encountered: