50060 sc insight scattered module processing pattern in arctoken update function
Description
Brief/Intro
Vulnerability Details
// Phase 1: Permission checks
address specificTransferModule = $.specificRestrictionModules[RestrictionTypes.TRANSFER_RESTRICTION_TYPE];
if (specificTransferModule != address(0)) { // ❌ Check #1
transferAllowed = transferAllowed && ITransferRestrictions(specificTransferModule).isTransferAllowed(from, to, amount);
}
address globalTransferModule = IRestrictionsRouter(routerAddr).getGlobalModuleAddress(RestrictionTypes.GLOBAL_SANCTIONS_TYPE);
if (globalTransferModule != address(0)) { // ❌ Check #2
try ITransferRestrictions(globalTransferModule).isTransferAllowed(from, to, amount) returns (bool globalAllowed) {
transferAllowed = transferAllowed && globalAllowed;
} catch {
transferAllowed = false;
}
}
// Phase 2: Before hooks - scattered across function
if (specificTransferModule != address(0)) { // ❌ Check #3 - same variable!
ITransferRestrictions(specificTransferModule).beforeTransfer(from, to, amount);
}
if (globalTransferModule != address(0)) { // ❌ Check #4 - same variable!
try ITransferRestrictions(globalTransferModule).beforeTransfer(from, to, amount) {}
catch {}
}
// Phase 3: After hooks - scattered again
if (specificTransferModule != address(0)) { // ❌ Check #5 - same variable!
ITransferRestrictions(specificTransferModule).afterTransfer(from, to, amount);
}
if (globalTransferModule != address(0)) { // ❌ Check #6 - same variable!
try ITransferRestrictions(globalTransferModule).afterTransfer(from, to, amount) {}
catch {}
}Impact Details
Recommendation
References
Proof of Concept
1
2
3
4
Previous51860 sc high missing access control in stakeonbehalf lets anyone bloat another user s validator list leading to permanent fund lock via gas exhaustion dosNext51850 sc low upgradetoken can not initialize an upgraded token because the data variable of upgradetoandcall is hardcoded to empty string
Was this helpful?