Skip to content

Commit c6cd4b9

Browse files
authored
docs: enhance fallback handler documentation in Safe.sol and IFallbackManager.sol (#879)
Updated the documentation for the fallback handler in both `Safe.sol` and `IFallbackManager.sol` to improve clarity and highlight security risks associated with setting the fallback handler. Added a warning about the potential for bypassing access control mechanisms when using untrusted addresses.
1 parent ff36adb commit c6cd4b9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

contracts/Safe.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {Enum} from "./libraries/Enum.sol";
2828
* 1. Transaction Guard: managed in `GuardManager` for transactions executed with `execTransaction`.
2929
* 2. Module Guard: managed in `ModuleManager` for transactions executed with `execTransactionFromModule`
3030
* - Modules: Modules are contracts that can be used to extend the write functionality of a Safe. Managed in `ModuleManager`.
31-
* - Fallback: Fallback handler is a contract that can provide additional read-only functionality for Safe. Managed in `FallbackManager`.
31+
* - Fallback: Fallback handler is a contract that can provide additional functionality for Safe. Managed in `FallbackManager`. Please read the security risks in the `IFallbackManager` interface.
3232
* Note: This version of the implementation contract doesn't emit events for the sake of gas efficiency and therefore requires a tracing node for indexing/
3333
* For the events-based implementation see `SafeL2.sol`.
3434
* @author Stefan George - @Georgi87

contracts/interfaces/IFallbackManager.sol

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ interface IFallbackManager {
1010

1111
/**
1212
* @notice Set Fallback Handler to `handler` for the Safe.
13-
* @dev Only fallback calls without value and with data will be forwarded.
14-
* This can only be done via a Safe transaction.
15-
* Cannot be set to the Safe itself.
13+
* @dev 1. Only fallback calls without value and with data will be forwarded.
14+
* 2. Changing the fallback handler can only be done via a Safe transaction.
15+
* 3. Cannot be set to the Safe itself.
16+
* 4. IMPORTANT! SECURITY RISK! The fallback handler can be set to any address and all the calls will be forwarded to it,
17+
* bypassing all the Safe's access control mechanisms. When setting the fallback handler, make sure to check the address
18+
* is a trusted contract and if it supports state changes, it implements the necessary checks.
1619
* @param handler contract to handle fallback calls.
1720
*/
1821
function setFallbackHandler(address handler) external;

0 commit comments

Comments
 (0)