The auth mechanism of AccessControl.sol uses function selectors (msg.sig) as a (unique) role definition. Also the _moduleCall allows the code to be extended.
Suppose an attacker wants to add the innocent-looking function left_branch_block(uint32) in a new module. Suppose this module is added via _moduleCall, and the attacker gets authorization for the innocent function.
This function happens to have a signature of 0x00000000, which is equal to the root authorization. In this way, the attacker could get authorization for the entire project.
Note: its pretty straightforward to generate function names for any signature value; you can just brute force it because its only 4 bytes.
Recommend not allowing third parties to define or suggest new modules and double-checking the function signatures of new functions of a new module for collisions.
albertocuestacanada (Yield) confirmed:
albertocuestacanada (Yield) acknowledged:
