Unexecutable proposals when Actions.MigrateKernel is not last instruction
The instruction module only enforced that a ChangeExecutor instruction appears last, but not that a MigrateKernel instruction does. If a MigrateKernel is followed by another action such as DeactivatePolicy, the later action can fail because it calls back into the policy through the kernel, which has already been replaced.
Submitted by Lambda
In INSTR.sol, it is correctly checked that a ChangeExecutor instruction only occurs at the last position to avoid situations where the other instructions are deemed as invalid.
However, the same problem can occur for MigrateKernel. For instance, let’s say we have a MigrateKernel followed by a DeactivatePolicy action. The MigrateKernel action will change the value of kernel within the policy. The DeactivatePolicy action tries to call setActiveStatus on the policy. However, this has a onlyKernel modifier and the call will therefore fail when it is done after the value of kernel was changed.
Recommended Mitigation Steps
Perform the same check for MigrateKernel.
fullyallocated (Olympus) confirmed and commented:
Thank you; good catch
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the ordering check that keeps ChangeExecutor last was not applied to MigrateKernel, so a kernel swap can precede actions that still depend on the old kernel.
Impact
A proposal containing a MigrateKernel before other actions may be unexecutable, since the later actions fail after the kernel value changes.
What the attacker needed
Proposal with MigrateKernel not last
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A proposal is a list of actions run in order. One action swaps out the central contract that other actions rely on to call back into the system. If that swap happens before another action runs, the later action talks to the wrong contract and fails, so the whole proposal cannot execute.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.