The missing validation of the prev
entry in the _uninstallExecutor
function can lead to corruption of the linked list of executors. This can have several consequences:
The linked list structure can be broken, leading to incorrect traversal and data retrieval.
Functions relying on the integrity of the linked list, such as getExecutorsPaginated
, will return incorrect data.
The _uninstallExecutor
function in ModuleManager.sol
is responsible for removing an executor from the linked list. It decodes the data
parameter to get the prev
entry and the disableModuleData
. It then calls the pop
function of the SentinelList
library to remove the executor from the executors linked list.
However, there is no check to ensure that the prev
entry actually points to the executor
to be removed. This can lead to a situation where an incorrect prev
entry is provided, causing the linked list to be corrupted.
Assume the linked list of validators is as follows: SENTINEL -> Executor1 -> Executor2 -> Executor3 -> SENTINEL
.
A call to _uninstallValidator
is made with prev
= Executor1
and validator
= Executor3
.
The function does not check if validators.getNext(Executor1)
equals Executor3
.
The pop
function is called, which sets self.entries[Executor1]
to self.entries[Executor3]
which is SENTINEL
The resulting list will look like: SENTINEL -> Validator1 -> SENTINEL
, with Validator2
incorrectly removed.
Add a check in the _uninstallExecutor
function to ensure that the prev
entry points to the executor
before calling the pop
function. This can be done by verifying that executors.getNext(prev) == executor
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.