Skip to content
Business logic Audit finding Beginner

Misleading event emission in createwhitelistrestrictions function in restrictionsfactory contract

The createWhitelistRestrictions function emits the caller's address as the owner in its event, even when a different address is set as the module's admin. Off-chain indexers and dashboards would therefore show the wrong owner for the restrictions module.

AasifUsmani Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

49915 sc low misleading event emission in createwhitelistrestrictions function in restrictionsfactory contract

Submitted on Jul 20th 2025 at 14:25:54 UTC by @AasifUsmani for Attackathon | Plume Network

Description

Brief/Intro

The createWhitelistRestrictions function in RestrictionsFactory.sol emits misleading event data when the actual admin of the created restrictions module differs from the function caller, leading to incorrect off-chain tracking and potential confusion about module ownership.

Vulnerability Details

Location
RestrictionsFactory.sol - createWhitelistRestrictions() function (lines 67-91)

Root Cause

The function always emits msg.sender as the "owner" in the RestrictionsCreated event, regardless of who actually receives admin privileges in the deployed restrictions module:

Solidity
function createWhitelistRestrictions(address admin) external returns (address) {
    // Actual admin logic: use provided admin or fallback to msg.sender
    bytes memory initData = abi.encodeWithSelector(
        WhitelistRestrictions.initialize.selector, 
        admin != address(0) ? admin : msg.sender
    );
    
    address proxy = _deployProxy(address(implementation), initData);
    
    // Always emits msg.sender as owner, not the actual admin!
    emit RestrictionsCreated(proxy, msg.sender, address(implementation), "Whitelist");
}

The Problem

The event field labeled as "owner" doesn't represent the actual admin/owner of the restrictions module, creating a disconnect between emitted data and contract reality.

Impact Details

Misleading Off-Chain Data
Off-chain systems, indexers, and user interfaces will incorrectly display module ownership information:

Solidity
// Scenario: Token owner delegates deployment to avoid gas fees
// Alice (token owner) asks Bob (deployer) to create restrictions with Alice as admin

createWhitelistRestrictions(alice); // Bob calls this function

// Reality: Alice becomes admin of the restrictions module
// Event: RestrictionsCreated(proxy, bob, implementation, "Whitelist")
// Problem: Event shows Bob as "owner" but Alice has actual control

Data Integrity Issues

  1. Incorrect Analytics: Dashboards will show wrong creator/owner statistics
  2. User Confusion: Users checking events will see incorrect ownership information
  3. Audit Trail Problems: Security monitoring systems will track wrong addresses as module controllers

References

https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/restrictions/RestrictionsFactory.sol#L87

Proof of Concept

{% stepper %} {% step %}

Step

Call createWhitelistRestrictions with different msg.sender and admin parameters. {% endstep %}

{% step %}

Step

Observe the emitted event: it will show msg.sender as the "owner" instead of the admin address that actually received control. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by AasifUsmani. 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 is hard-coded to use msg.sender as the owner instead of the admin address that is actually passed to the module's initialiser.

Impact

Off-chain indexers, dashboards and monitoring systems could record and display the wrong owner of a restrictions module, causing incorrect analytics and audit trails.

What the attacker needed

Ability to call the factory function

The fix

The event should emit the actual admin address (the provided admin, or msg.sender when none is given) rather than always msg.sender.

How it was found

  1. Call createWhitelistRestrictions with a msg.sender that differs from the admin parameter.
  2. Observe the emitted event showing msg.sender as the owner rather than the admin.

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 can announce what it did by emitting an event, which off-chain software reads to keep records. Here the announcement names the person who triggered the function as the owner, but the contract actually gave control to a different address. Anyone relying on those records would see the wrong owner.

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 AasifUsmani

View all

8 more disclosed reports, 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.