Skip to content
Business logic Audit finding Intermediate

Admin cannot be changed to EOA after deployment

The Kernel contract allows the admin address to be changed to any address, including an externally owned account (EOA), but after deployment only the INSTR contract can call executeAction, and INSTR only permits contract targets. This means the admin can never be changed to an EOA, which appears to be the intended design.

Jeiwan Follow

Originally disclosed on Code4rena

Submitted by Jeiwan, also found by datapunk

After contracts are deployed and initialized, the admin address in Kernel contract can only be set to a contract. Granting and revoking roles will be possible to do only via a contract, which looks like an unintended behavior since these operations cannot be performed via governance (the governance contract is designed to be the only executor).

Proof of Concept

Admin address can be changed to any address (EOA or contract) in the executeAction function in Kernel: https://github.com/code-423n4/2022-08-olympus/blob/main/src/Kernel.sol#L252-L253

This piece explicitly allows EOA addresses since the other actions in the function (besides ChangeExecutor) are checked to have only a contract as the target (see ensureContract function calls in the other actions). This, and the fact that roles cannot be managed via governance, leads to the conclusion that an admin is designed to be an EOA.

However, in the store function in INSTR, action target can only be a contract: https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/INSTR.sol#L52

After the contracts are deployed, INSTR will be the only contract that’s allowed to call Kernel.executeAction: https://github.com/code-423n4/2022-08-olympus/blob/main/src/scripts/Deploy.sol#L220

Thus, there will be no way to change admin to an EOA. If admin needs to be an EOA, the INSTR contract needs to be patched and re-deployed to allow non-contract targets.

Recommended Mitigation Steps

Allow EOA addresses as instruction targets or disallow non-contract admin addresses.

fullyallocated (Olympus) confirmed and commented:

Nice find + writeup.


The original report as published on Code4rena, by Jeiwan. 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 INSTR module's store function enforces that action targets must be contracts, while the Kernel's executeAction allows any address, creating an inconsistency that prevents setting an EOA as admin after deployment.

Impact

The admin cannot be changed to an EOA after deployment, which may prevent intended governance operations if an EOA admin was expected.

What the attacker needed

Contracts deployed and initialized

The fix

Allow EOA addresses as instruction targets or disallow non-contract admin addresses.

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.

Smart contracts often have an admin who can grant or revoke roles. Here, the code that changes the admin allows any address, but a later check only allows contracts, so you can never set an ordinary wallet as admin. That may be a problem if the design intended a wallet to be admin.

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 Jeiwan

View all

69 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.