51286 sc low event restrictionscreated uses wrong owner
Description
Brief / Intro
Vulnerability Details
function createWhitelistRestrictions(address admin) external returns (address) {
// Deploy a fresh implementation
WhitelistRestrictions implementation = new WhitelistRestrictions();
// Add the implementation to the whitelist
FactoryStorage storage fs = _getFactoryStorage();
bytes32 codeHash = _getCodeHash(address(implementation));
fs.allowedImplementations[codeHash] = true;
// Deploy proxy with the fresh implementation
bytes memory initData =
abi.encodeWithSelector(WhitelistRestrictions.initialize.selector, admin != address(0) ? admin : msg.sender); // @audit
address proxy = _deployProxy(address(implementation), initData);
// Store the mapping
fs.restrictionsToImplementation[proxy] = address(implementation);
emit RestrictionsCreated(proxy, msg.sender, address(implementation), "Whitelist"); // @audit
emit ImplementationWhitelisted(address(implementation));
return proxy;
}Impact Details
References
Proof of Concept
Previous52944 sc high the requestcommisionclaim function can only claim commission on tokens that are currently reward tokensNext50713 sc high deployer s default admin role enables self grant of upgrader role bypassing implementation whitelist
Was this helpful?