Description:
When configureDependencies
is called via Kernel::_activatePolicy
, it then pushes the returned dependencies into a Kernel::moduleDependents
mapping. This mapping is used to reconfigure the policy in case any of the modules which policy is dependent on changes. However, in the configureDependencies
function, when setting dependencies array to return the MONEY
keycode is overwritten by WEAPN
keycode.
Impact:
This does not affect the functionality of the contracts in normal state. However, when transitioning to emergency mode, the emergency deploy function executes UpgradeModule
Action, which requires correct dependencies to work. Since the Laundrette
policy is not set as a dependency for the MONEY
keycode, upgrading this Keycode won't trigger this policy to reconfigure. As a result, all functions in Laundrette
still work as if it is still in normal mode, and gang members still can call WithdrawMoney
successfully.
Proof of Concept:
To prove the concept, add the following test to EmergencyMigration.t.sol
, Exploit Steps:
gangM1
joins gang.
gangM1
deposits some USDC to test it after emergency.
godfather
enters emergency mode via calling migrate.
gangM1
withdraws as if in normal mode.
PoC:
Recommended Mitigation:
The fix is simple, just ensure the configureDependencies
function returns the correct dependencies array:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.