Skip to content
Business logic Audit finding Beginner

Event:: RestrictionsCreated always emits msg.sender as Owner

The createWhitelistRestrictions function emits the RestrictionsCreated event with msg.sender as the owner, even when a different admin address is provided and becomes the actual controller. This causes off-chain monitoring and tooling to misrepresent the ownership of the deployed module.

Killua Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

51989 sc low event restrictionscreated always emits msg sender as owner

Submitted on Aug 7th 2025 at 04:35:12 UTC by @Killua for Attackathon | Plume Network

Description

The createWhitelistRestrictions() function in the RestrictionsFactory contract always emits msg.sender as the owner in the RestrictionsCreated event.

When an admin parameter is provided, that admin becomes the actual controller of the restrictions module, but the event incorrectly logs msg.sender as the owner. The actual owner should be: admin != address(0) ? admin : msg.sender

Vulnerability Details

The event emission currently uses:

emit RestrictionsCreated(proxy, msg.sender, address(implementation), "Whitelist");

This will always log msg.sender as the owner even when a different admin was supplied and initialized as the controller.

Impact Details

  • Event logs will not accurately reflect the actual control structure of deployed modules.
  • Possible off-chain monitoring and tooling may misrepresent ownership/control of the deployed module.

Proof of Concept

Relevant snippet showing initialization and event emit:

Solidity
function createWhitelistRestrictions(address admin) external returns (address) {
    // ... existing code ...
     
    bytes memory initData =
        abi.encodeWithSelector(WhitelistRestrictions.initialize.selector, admin != address(0) ? admin : msg.sender);
    
    address proxy = _deployProxy(address(implementation), initData);
    
    // @audit Emits msg.sender always. 
    emit RestrictionsCreated(proxy, msg.sender, address(implementation), "Whitelist");

    //..//..
}

Suggested change (conceptual) — capture the actual admin and use it in the event emission:

Solidity
address actualAdmin = admin != address(0) ? admin : msg.sender;
emit RestrictionsCreated(proxy, actualAdmin, address(implementation), "Whitelist");

References

Original event usage:

emit RestrictionsCreated(proxy, msg.sender, address(implementation), "Whitelist");

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

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

The event emission hardcodes msg.sender instead of using the resolved admin address (admin if non-zero, otherwise msg.sender).

Impact

Off-chain monitoring and tooling may misrepresent ownership/control of the deployed module.

What the attacker needed

None

The fix

The event should be emitted with the actual admin address, i.e., admin if it is not the zero address, otherwise msg.sender.

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 smart contract function creates a new restrictions module and records who owns it in an event log. The log always names the person who called the function, even if they asked for someone else to be the owner. This means anyone watching the logs will think the wrong person is in charge.

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 Killua

View all

1 more disclosed report, best first.

More from Plume Network

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.