Skip to content

Commit d38d53d

Browse files
hanzel98McOso
andauthored
Audit May 2025 - 7.1.1 and 7.1.2 - No Execution Mode Restriction And Security Notice (#103)
* Audit May 2025 - 7.1.1 and 7.1.2 - No Execution Mode Restriction And Security Notice * Update src/enforcers/LogicalOrWrapperEnforcer.sol Co-authored-by: Ryan <[email protected]> --------- Co-authored-by: Ryan <[email protected]>
1 parent e6fa7ab commit d38d53d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/enforcers/LogicalOrWrapperEnforcer.sol

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,24 @@ import { ModeCode, Caveat } from "../utils/Types.sol";
3131
* @dev Behavior:
3232
* - The enforcer iterates over all caveats in the specified `CaveatGroup`.
3333
* - For a group to pass, all caveats within that group must succeed.
34-
* - Every caveat in the group is evaluated,
34+
* - Every caveat in the group is evaluated.
3535
* - The group index provided via `SelectedGroup.groupIndex` must be valid (i.e. less than or equal to the length of the terms
3636
* array).
3737
* - The length of `SelectedGroup.caveatArgs` must exactly match the number of caveats in the corresponding `CaveatGroup`.
3838
* Empty bytes can be used for caveats that do not require arguments.
39+
*
40+
* @dev Security Notice: This enforcer allows the redeemer to choose which caveat group to use at
41+
* execution time, via the groupIndex parameter. If multiple caveat groups are defined with varying
42+
* levels of restrictions, the redeemer can select the least restrictive group, bypassing stricter
43+
* requirements in other groups.
44+
*
45+
* To maintain proper security:
46+
* - Ensure each caveat group represents a complete and equally secure permission set.
47+
* - Never assume the redeemer will select the most restrictive group.
48+
* - Design caveat groups with the understanding that the redeemer will choose the path of least
49+
* resistance.
50+
*
51+
* Use this enforcer at your own risk and ensure it aligns with your intended security model.
3952
*/
4053
contract LogicalOrWrapperEnforcer is CaveatEnforcer {
4154
using ExecutionLib for bytes;
@@ -114,7 +127,6 @@ contract LogicalOrWrapperEnforcer is CaveatEnforcer {
114127
)
115128
public
116129
override
117-
onlyDefaultExecutionMode(_mode)
118130
onlyDelegationManager
119131
{
120132
_executeHook(

0 commit comments

Comments
 (0)