-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Even if the users use batch operations, removing calldata with indexes can cause unexpected behaviours #20
Comments
This logic will need to be enshrined on the frontend. My guess is that destructive actions that remove checks will execute on a fairly infrequent basis, and actions that add checks will happen much more frequently. You are right that it is hard to reason about this kind of thing on the frontend. What we can do is say, if a user tries to modify an index they already have a timelocked operation for, do not allow them to make modifications to that same index as it is too hard to reason about. Will leave severity to @GalloDaSballo as this may have been already covered in his report before the c4 competition. |
I think the only 2 rational ways to look at this are:
I do not believe we can consider the finding as valid, because the pre-condition is a set of owners that don't cancel the proposals, meaning their behaviour creates undefined execution because they themselves allow it, while it being known (from my report) |
GalloDaSballo changed the severity to QA (Quality Assurance) |
After second consideration I believe this issue is a medium risk issue. I want to add my comment based on #20 (comment) For the first part ( Invalid Known Issue ), it shouldn't be classified as known issue because in your Recon report for this issue marked as acknowledged based on the following comment:
In my report, I demonstrated that a meaningful risk still exists even if users batch their operations in this scenario. Due to time gaps, it’s not always feasible to mitigate this risk effectively with batch operations alone. So, it shouldn't be classified as known issue. Second part ( Valid QA ): Initially, when I encountered this issue in the codebase, I was uncertain about its severity, considering it to fall between Medium and Low. However, upon further analysis, I now believe it should be classified as Medium severity. This is a multi-signature wallet used by multiple users, so there is a greater likelihood of this scenario occurring. Users may not be able to track or execute actions in the correct order. If, at timestamp
As the definition of medium severity issue in C4, it should be a medium severity issue. My proposed mitigation, which uses a |
Per the Supreme Court verdict we have to assume users performing reasoned operations For this reason, I think QA is the most appropriate severity |
I am assuming users performing reasoned operations. There are time gaps between the executions. Timelock can accept up to 30 days delay. Users can't use batch operations with this time gaps. Can you please reconsider the PoC that the issue reported because I used only reasoned operations in PoC. |
Lines of code
https://github.com/solidity-labs-io/kleidi/blob/0d72b6cb5725c1380212dc76257da96fcfacf22f/src/Timelock.sol#L1193-L1243
Vulnerability details
Proof of Concept
In the timelock contract, removing calldata can be done by using indexes. Each calldata is stored in a list in the contract states and it can be removed from the timelock using indexes including the delay. The delay is important thing here because in timelock we cannot create calldata for timelock itself, therefore, any removing calldata action should be scheduled by Gnosis safe. The delay can be determined while scheduling but it should be higher than min delay. The problem in this timelock design is indexes. They can cause unexpected behaviours while execution timestamp even though they're accurate while scheduling due to delay mechanism in the timelock.
Actually, it's also reported by Alex in Recon report but in mitigation part, they decided to use batch scheduling mechanism in order to be sure about execution order of tasks.
But even if the users use batch operations for executions removing the calldata with index is not a safe method due to high delays between the operations.
Let's examine the following scenario:
In this scenario, we can't use batch operations because our user's decisions has time gaps and this is why this is still a problem here.
Impact
Actually, I believe this issue is between Medium/Low. Because user can always cancel the wrong proposals. But in reality, it can be disaster for the real users because they should always check whether the new scheduled action affect the existing live proposals and executions can be done by anyone after the delay period, it should also be considered in this situation. I believe judge can decide a correct severity for this report but I am marking it as medium for now.
Recommended Mitigation Steps
In the mitigation part, my professional advice is using
nonce
for the scheduled executions and while removing them using thisnonce
is better than the current execution flow.Assessed type
Timing
The text was updated successfully, but these errors were encountered: