Closed c4-submissions closed 10 months ago
raymondfam marked the issue as low quality report
raymondfam marked the issue as duplicate of #368
alex-ppg marked the issue as not a duplicate
The fallback handler of a Gnosis Safe deployed via the SafeDeployer
is automatically set via the IGnosisSafe::setup
call that is encoded at the end of the relevant function body.
As such, the fallback handler is properly set and does not need to perform any special delegate call instruction.
alex-ppg marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-10-brahma/blob/dd0b41031b199a0aa214e50758943712f9f574a0/contracts/src/core/SafeDeployer.sol#L118-L130
Vulnerability details
Impact
According to the docs, the fallback handler provides compatibility between pre-1.3.0 and 1.3.0+ Safe contracts, and additionally, also ensures policy validation guarantees required for ConsoleAccounts/SubAccounts that have policy validation enabled. If not set, this functionality will not be available.
Proof of Concept
In ConsoleOpBuilder.enablePolicyOnConsole(), it was explicitly stated what needs to be done if policy is enabled: https://github.com/code-423n4/2023-10-brahma/blob/dd0b41031b199a0aa214e50758943712f9f574a0/contracts/src/core/ConsoleOpBuilder.sol#L25C5-L25C124
This was implemented as stated in ConsoleOpBuilder.enablePolicyOnConsole(), a function that returns the multicall bytecode for enabling policy on brahma console account. https://github.com/code-423n4/2023-10-brahma/blob/dd0b41031b199a0aa214e50758943712f9f574a0/contracts/src/core/ConsoleOpBuilder.sol#L53-L56
However, in SafeDeployer._setupConsoleAccount(), if policy is enabled, fallback handler address is obtained but not set in safe., only guard was set there. https://github.com/code-423n4/2023-10-brahma/blob/dd0b41031b199a0aa214e50758943712f9f574a0/contracts/src/core/SafeDeployer.sol#L118-L130
Tools Used
Manual review.
Recommended Mitigation Steps
Plsease kindly Include setting the fallBack on safe in the multicall transaction when policy is being set, thank you.
Assessed type
Other