Skip to content
Business logic Audit finding Intermediate

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.

Lambda Follow

Originally disclosed on Code4rena

Submitted by Lambda

https://github.com/code-423n4/2022-08-olympus/blob/549b96bcf8b97807738572605f6b1e26b33ef411/src/modules/INSTR.sol#L61

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


The original report as published on Code4rena, by Lambda. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by Lambda

View all

64 more disclosed reports, best first.

More from Olympus DAO contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.