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.
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
- Report ID: #49915
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/restrictions/RestrictionsFactory.sol
- Impacts: Contract fails to deliver promised returns, but doesn't lose value
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:
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:
// 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
- Incorrect Analytics: Dashboards will show wrong creator/owner statistics
- User Confusion: Users checking events will see incorrect ownership information
- Audit Trail Problems: Security monitoring systems will track wrong addresses as module controllers
References
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 %}
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
- Call createWhitelistRestrictions with a msg.sender that differs from the admin parameter.
- 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.